topical media & game development
#javascript-code-25-createelementns.js / js
// Create a new XHTML-compliant <p>
var p = document.createElementNS("http://www.w3.org/1999/xhtml", "p");
// Add some text into the <p> element
p.appendChild( document.createTextNode( “Welcome to my site.” ) );
// Add the <p> element into the document
document.body.insertBefore( p, document.body.firstChild );
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.