home / experts / javascript / column75 |
|
Referencing ObjectsThe worst habit to get rid of when scripting Netscape 6 is how you reference HTML objects. Internet Explorer has turned us into spoiled scripters. The following HTML tag, for example:
renders as follows: Be sure to close this paragraph. We can reference this tag in Internet Explorer just by its ID. For example, to figure out its location we state:
This does not work in Netscape 6. You cannot access objects just by their HTML ID. You need to use:
to find the object, and only then compute the object's properties. The following button calls Here is how we define the button:
And here is how we define the
The following code works as well:
Next: How to create and remove attributes on the fly |
Produced by Yehuda Shiran and Tomer Shiran
All Rights Reserved. Legal Notices.
Created: January 15, 2001
Revised: January 15, 2001
URL: http://www.webreference.com/js/column75/5.html