
September 2nd, 2004, 12:16 PM
|
|
Registered User
|
|
Join Date: Jul 2003
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
How to define new properties for existing HTML objects
With IE it's really easy to define a new property for an existing HTML object. It's sufficent to name it! For example in IE the following code
Code:
<img name="Img1" author="authorName" onClick="alert(document.Img1.author)" src="img1.gif" width="24" height="24">
creates the property named "author" with the value "authorName" for the object "document.Img1". When the image is clicked the value "authorName" is showed in the messagebox.
But this does not work with firefox, my new browser (which I like much more): the message box displays "undefined"
Is there a standard way to add a property to an object which works with IE and FF ?
Thanks.
|