
Originally Posted by
wishiwasageek
Code:
sObj = d.getElementById("container").style
The above requires an element having the attribute id="container". Ex:
HTML Code:
<div id="container">
some stuff can go here
</div>
The word 'container' must be spelled exactly the same, case sensitive, in both the script and html code. In addition, said element must have been parsed by the browser before the code is executed.
About doctype - A doctype looks something like this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
and (if used) is the very first thing on a page. Most doctypes invalidate IE's use of 'document.body', requiring instead the more standard 'document.documentElement' however, since some older versions of IE don't recognize doctypes, simply changing to documentElement will mess things up on them, that is another discussion. I'm not familiar with HTML-KIT but, it may assume a doctype even if none is specified.
Bookmarks