Remove element within iframe

Asked

Viewed 484 times

0

Hello

I have an Iframe that has an image and would like to remove it, but it’s not working...

<script>
  $( document).ready(function() { 
    $(document).find("img[src='/assets/online/cf_logo-9733d198a764182fc89bc38518f73f91efd7a413394b1ca263e8ba4774ed8b5b.png']").hide();

  });
</script>

If I inspect the image and paste the . Hide() line into the console, it hides. If I don’t inspect the image and paste, nothing happens as well as when I upload the page

Any suggestions?

Thank you

1 answer

0

Try it this way. I put a setTimeOut to be more visible

setTimeout(function(){ $("img[src='/assets/online/cf_logo-9733d198a764182fc89bc38518f73f91efd7a413394b1ca263e8ba4774ed8b5b.png']").hide();; }, 4000);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<img src='/assets/online/cf_logo-9733d198a764182fc89bc38518f73f91efd7a413394b1ca263e8ba4774ed8b5b.png'/>

  • It’s still the same... :(

  • If the image changes src try to take by xpath or post the html of the iframe so that I help you better

Browser other questions tagged

You are not signed in. Login or sign up in order to post.