是否有可能关闭包含另一个HTML的div?

时间:2014-07-31 06:48:50

标签: javascript jquery html

是否可以关闭或清空包含html的div?你要关闭/清空div的代码在html中。我的div是一个弹出窗口。

像这样。

<div id="n_test">
    <object data="test.php">
     #document
     <html>......
     the code that empty the id="n_test"
     </html>
   </object>
</div>

1 个答案:

答案 0 :(得分:0)

在jquery中使用has选择器,不要在div标签内使用html ......

HTML

 <div id="n_test">
     #document
     <ifame>......
     the code that empty the id="n_test"
     </ifame>
</div>

JS

$(document).ready(function(){
$("#n_test").has("ifame").hide();
});

DEMO