02.png

    1. <ul>
    2. <li>html <button>删除</button></li>
    3. <li>css <button>删除</button></li>
    4. <li>js <button>删除</button></li>
    5. </ul>
    6. var btns = document.getElementsByTagName("button")
    7. for(var i=0;i<btns.length;i++){
    8. btns[i].onclick = function(){
    9. var temp = window.confirm("确定吗")
    10. if(temp){
    11. this.parentNode.style.display = "none"
    12. }
    13. }
    14. }