Entry
Netscape 6 has document.getElementByID. What is the equivalent in Netscape 7?
Nov 1st, 2002 16:19
Mark Filipak, Pete Ruby,
I don't have NN7, but I assume that it is also W3C DOM compatible. If
so, then the method is the same:
document.getElementById('myId')
If you are encountering difficulties using it, perhaps the problem lies
in your HTML code. If so, be advised that you need to define two
tags-worth of information to get the element properly 'id'ed. They are:
1) a named STYLE, i.e, that is prefixed by the pound-sign char (#), and
2) an 'id'ed DIV or SPAN. For example:
<HTML>
<HEAD>
<STYLE>#myId {...CSS rule set goes here...}</style>
</head>
<BODY>
<DIV id='myId'>...DIV content goes here...</div>
</body>
</html>
That should do it. Just be sure to use STYLE in the HEAD, and DIV (or
SPAN for an inline object) in the BODY. Of course, both the STYLE and
the DIV must use the same id ('myId' in the example).
[...later...] Aha! I just noticed that your question has this:
getElementByID
That is not correct. It should be:
getElementById
(note: lower case 'd' in 'Id'). I hope that helps.
-- Mark Filipak