标签:
1 document.getElementById("purchases")
1 document.getElementsByTagName("li") 2 alert(document.getElementsByTagName("li").length);
1 document.getElementsByClassName("sale")
1 var paras = document.getElementsByTagName("p"); 2 for(var i=0;i < paras.length;i++){ 3 alert(paras[i].getAttribute("title")); 4 }
1 var shopping = document.getElementById("purchases"); 2 shopping.setAttribute("title","a list of goods");
1 var body_element = document.getElementByTagName("body")[0]; 2 body_element.childNodes 3 document.getElementByTagName("body")[0].childNodes
1 alert(body_element.nodeType);
1 alert(decription.nodeValue); 2 alert(decription.childNodes[0].nodeValue);
javascriptDOM编程艺术_学习笔记_知识点 DOM
标签:
原文地址:http://www.cnblogs.com/mxc-success/p/4306373.html