Skip to content Skip to sidebar Skip to footer

Inserting A Div Element Inside Of An Iframe

I am trying to insert a div element inside of a iframe to which I would like to eventually apply a perfect scrollbar. As of now I have been able to insert the iframe inside div and

Solution 1:

You cannot manipulate content in an iFrame you do not control. So, in most cases this is same-domain only. If it is another domain, you run into the cross-domain issue which is mostly unsolvable unless you own the other site as well


Solution 2:

$('#iframe')     
          .contents().find('body')
          .append('mynewcontent goes here');

Post a Comment for "Inserting A Div Element Inside Of An Iframe"