Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Ionic 3 Angular DOM manipulation

$
0
0

@dimitri320 wrote:

I’m trying to manipulate the DOM dynamically from my TS (JS) by using the following line of code:

document.getElementsByTagName("ion-backdrop")

When outputting this to the console, it writes “HTMLCollection []”.

My problem is that beyond this point, nothing appears to work. I’ve tried the following methods, and all don’t work.

document.getElementsByTagName("ion-backdrop").[0].styles.background("#000")
document.getElementsByTagName("ion-backdrop")[0]. setAttribute("background", #000)

Can anyone suggest how can I dynamically change the background? FYI, I don’t have access to the HTML (this is a native Ionic component).

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>