Changing CSS in iframe with jQuery

Changing CSS in iframe with jQuery

Hello,


i want to change the CSS of an iframe (iframe content comes from the same domain but the iframe should be displayed a little differently, which is why I cannot change the CSS on the main page) as easily as possible using jquery? The code should also work if the iframe is lazy loaded.


The following code doesn´t work for me (without lazy load and with lazy load):


<script>$("iframe").contents().find("#Anker-PowerCore-10000mAh").css("display", "none");</script>


#Anker-PowerCore-10000mAh is the id of the element in the iframe content which should be hidden. I´m using Wordpress. The running jquery Version is 1.12.4


Can someone please help me there? I don't really know about jquery and I just can't get any further
1
Edit DeleteReply