var oUl12_3=document.getElementById('ul12_3'); var aA12_3=oUl12_3.getElementsByTagName('a'); for (var i=0; i < aA12_3.length ; i++) { aA12_3[i].onclick=function() { oUl12_3.removeChild(this.parentNode); } }