0

I managed to style the third-party-generated iframe in my page but can't style anything inside it. I can't figure out why the code below doesn't do anything:

jQuery(window).load(function() {
  var $ = jQuery;    
  setTimeout(function() {
    $('.mailmunch-embedded-iframe').find('#mailmunch-optin-form').css('border', '10px solid blue');
  }, 1000);
});

If I remove find('#mailmunch-optin-form') in order to apply this code to the iframe itself it works. But for something inside it, it doesn't. What's going on?

drake035
  • 3,955
  • 41
  • 119
  • 229
  • Possible duplicate of [jQuery/JavaScript: accessing contents of an iframe](http://stackoverflow.com/questions/364952/jquery-javascript-accessing-contents-of-an-iframe) – jmargolisvt Apr 18 '17 at 17:56
  • that isn't how to access inside an iframe, they have their own `window`...and you can't anyway due to *"same origin policy"* – charlietfl Apr 18 '17 at 18:07

0 Answers0