<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title></title> <script> window.onload = function(){ var oUl = document.getElementById("ul1"); var aA = document.getElementsByTagName("a"); for(var i = 0 ; i < aA.length;i++) { aA[i].onclick = function(){ oUl.removeChild(this.parentNode); } } } </script> </head> <body> <ul id="ul1"> <li>aasd<a href="javascript:;">删除</a></li> <li>qwee<a href="javascript:;">删除</a></li> <li>asdsasd<a href="javascript:;">删除</a></li> <li>sdgfsdf<a href="javascript:;">删除</a></li> </ul> </body> </html>