functionattachEvents(){varelement=document.getElementById("myID");element.onclick=function(){alert("Elementclicked");}};attachEvents(); 查看完整描述