HomeDHTML Page 8 - Rough Guide To The DOM (part 1)
Shazam! - DHTML
It's the bane of Web developers everywhere - conflicting standards, browser incompatibilities, and code that changes every time a new browser version hits the Web. But fear not - charging in on a white steed comes a heroic knight, clad in the attire of the new W3C DOM and armed with the tools to make this nightmare end forever. Read on to find out how the new DOM finally brings some standards to the decidedly non-standard world of the Web.
The DOM also allows you to modify CSS properties of specific HTML tags - asthe following example demonstrates:
var obj = document.getElementById("mirage");
obj.style.display = "none";
Now you see it...
I've done something similar in the very first example in this article -take a look at that one too, while you're at it.
Using this technique, it's possible to apply almost any inline style to anelement on the page. Remember that style properties which are hyphenated -for example, "background-color" and "font-family" - need to be written as asingle word with the first character after the hyphen capitalized - forexample, "backgroundColor" and fontFamily". The next example shouldillustrate this clearly: