我使用iframe在我的 CI 项目中添加了一个 html 页面。现在我想从包含的页面中删除第一个 div 。该div没有ID。我写了一个 jquery 代码,但它删除了整个 iframe。这里是
$(document).ready(function(){
$("iframe").load(function(){
//$('div:first').remove();
$("body").find("div:first-child").remove();
});
});
html
<div class="span12">
<iframe id="patrolIframe" width="100%" height="900" frameborder="0" scrolling="yes" allowtransparency="true"
src="http://...../map.html"></iframe>
</div>