感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script>
<div id="div1" style="height:100px;width:300px;border:1px solid black;background-color:yellow;">
这是 div 中的一些文本。
<p class="part">这是在 div 中的一个段落。</p>
<p>这是在 div 中的另外一个段落。</p>
</div>
<br>
<button>移除div元素</button>
<p>
在使用 remove() 的过滤器删除时,不能删除带有过滤器的子元素。
</p>
xxxxxxxxxx
$(document).ready(function(){
$("button").click(function(){
$("#div1").remove(".part");
});
输入 CSS 代码……