How To Add New Elements Dynamically


  • 17 Feb, 2012

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><title>Title of page</title><script type="text/javascript">function addNode() { var newP = document.createElement("p"); var textNode = document.createTextNode(" I'm a new text node"); newP.appendChild(textNode); document.getElementById("firstP").appendChild(newP);}</script></head><body onload="addNode();" style=" background: url('../images/Sand-1280.jpg'); background-color: yellow;"><p id="firstP">firstP<p></body></html>

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.