<script src="showpic.js"></script> // document.write()
document.getElementById("ltest") alert(test.innerhtml) //Display the attribute value of the node whose id is test.
var test=document.getElementById("test") test.innerhtml="<p>...</p>" sets the attribute value for the node whose id is test.
var para= document.createElement("p")//Create element node var text= document.creatTextNode("Hello World")//Create a text node para.appendChild(text)//Insert the text node into the element node
//Check createElememt. function(){ var para=document.creatElement("p") var info="nodeName: " info+=para.nodeName info+="nodeType: " info+=para.nodeType alert(info) }
//Using creatElement, creatTextNode and appendChild methods to create image display tags and description tags var holeplace = document.creatElement("img") //Create img element node holdplace.setAttribute("id","holdplace") //Define the Id attribute value holdplace.setAttribute("src",holdplace.png) // define the src attribute value var description=document.createElement("p") // create p node element var destext=document.creatTextNode("Chose a gif")//Create a text node element description.appendChild(destext) //Insert text nodes into and out of element nodes // Insert the image's display tag and description tag into the text. document.body.appendChild(holdplace) document.body.appendChild(description)