document.getElementById("spec_area").addEventListener("click",function(e) {
// 檢查事件源e.targe是否爲Li
//console.log(e.target);
// console.log(e.target.nodeName);
if(e.target && e.target.nodeName == "INPUT") {
// // 真正的處理過程在這裏
// console.log("List item ",e.target.id.replace("post-")," was clicked!");
console.log("111");
console.log(e.target);
var target=e.target;
target.onkeyup=function(){
console.log("111");
document.getElementById("new_library").innerHTML='';
}
}
});node
網上的examplepost
document.getElementById("parent-list").addEventListener("click",function(e) { // 檢查事件源e.targe是否爲Li if(e.target && e.target.nodeName.toUpperCase == "LI") { // 真正的處理過程在這裏 console.log("List item ",e.target.id.replace("post-")," was clicked!"); } });