<ul>
<li>html <button>删除</button></li>
<li>css <button>删除</button></li>
<li>js <button>删除</button></li>
</ul>
var btns = document.getElementsByTagName("button")
for(var i=0;i<btns.length;i++){
btns[i].onclick = function(){
var temp = window.confirm("确定吗")
if(temp){
this.parentNode.style.display = "none"
}
}
}