问题描述
- 求大神看看,怎么没效果
-
```<!doctype html>window.onload=function(){
var dl=document.createElement('dl');
var dts=document.getElementsByTagName('abbr');
for (var i=0; i<dts.length ; i++) {
var dt=document.createElement('dt');
var dd=document.createElement('dd');var atext=dts[i].firstChild.nodeValue;
var a=document.createTextNode('atext');
var btext=dts[i].getAttribute('title');
var b=document.createTextNode('btext');
dt.appendChild('a');
dd.appendChild('b');
dl.appendChild('dt');
dl.appendChild('dd');};
document.body.appendChild('dl');
}Explaining the Document object Model
What is the Document object Model?
The W3C defines the DOM as:
A platform and language-netural interface that will allow programs and scripts to dynamically access and update the content ,structure and style of documents.
It is an API that can be used to navigate HTML and XML documents