'Remove some element in iframe with jquery
In the code below, with jquery, I'd like remove element (and the child 'li') and after that add some code to the
Could you tell me how do this ?
<iframe id="myIframe">
#document
<html>
<head>
</head>
<body>
<div class="spinner" style="display:none;"></div>
<ul>
<li>
<p contenteditable="false">11111</p>
</li>
<li>
<p contenteditable="true"></p>
</li>
</ul>
</body>
</html>
</iframe>
I have a function for this :
function Delete(iframeName) {
$('#' + iframeName)
}
Thanks,
Solution 1:[1]
$("#myIframe").contents().find("#mydiv").remove();
However, this assumes the browser is not blocking access to the iframe. If the iframe is hosted on another domain and has cross-domain security measures enabled it will not allow you to change the content in the iframe.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Olaf |
