为什么最后一个div删除不了?求解
<divid="wps"><divid="box"><divclass="jian">3</div><divclass="jian">3</div><divclass="...
<div id="wps">
<div id="box">
<div class="jian">3</div>
<div class="jian">3</div>
<div class="jian">3</div>
</div>
<div id="box">
<div class="jian">4</div>
<div class="jian">4</div>
<div class="jian">4</div>
</div>
</div>
<button onclick="shi()">sdf</button>
<script>
function shi(){
var boxid=document.all.box;
boxid[0].remove();
}
</script> 展开
<div id="box">
<div class="jian">3</div>
<div class="jian">3</div>
<div class="jian">3</div>
</div>
<div id="box">
<div class="jian">4</div>
<div class="jian">4</div>
<div class="jian">4</div>
</div>
</div>
<button onclick="shi()">sdf</button>
<script>
function shi(){
var boxid=document.all.box;
boxid[0].remove();
}
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询