DOM -- Exemple


Changer la couleur du texte dans une page HTML

// get the HTML body element from the document
var children = doc.getElementsByTagName("body");
// there is one HTML body element for each HTML 4.0 document
var body   = children.item(0);
// change the value of the CSS2 color property
body.style.color = "green";