Mozilla stuff

Uhm...

2004-08-30

createDocumentType

var newdoctype = document.implementation.createDocumentType("html", "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd");
var XMLoutput = document.implementation.createDocument("http://www.w3.org/1999/xhtml","", newdoctype);
var el1 = XMLoutput.createElement("elem");
XMLoutput.appendChild(el1);

var div = XMLoutput.createElement("div");
el1.appendChild(div);

var s = new XMLSerializer();
var str = s.serializeToString(XMLoutput);
alert(str);

0 Comments:

Post a Comment

<< Home