移除前
移除后
这个要怎么处理?
代码:
function removelast(){
$("#mend").children("input[type='checkbox']:last").remove();
}
发布于 2017-12-01 06:25:14
用个容器,如label把文字和checkbox括起,然后移除容器。要不文字和checkbox是2个不同的节点,你移除checkbox当然无法移除文字
<label><input type="checkbox"/>测试店2</label>
然后这样
$("#mend").children("input[type='checkbox']:last").parent().remove();
相似问题
领取专属 10元无门槛券
AI混元助手 在线答疑
洞察 腾讯核心技术
剖析业界实践案例