Accessing an DOM attribute in JavaScript

Associate
Joined
6 Dec 2002
Posts
661
Location
Belfast
Accessing a DOM attribute in JavaScript

Take the following HTML code:
Code:
...
<a tooltiptext="The content of the tooltip" onmouseover="someFunction(tooltiptext);" href="#">Link</a>
...
Within IE the above code works perfectly in that the tooltiptext attribute can be passed straight into the someFunction function simply by stating it's name. However this does not work in Firefox. I have tried this.tooltiptext but it just states 'undefined'. How can I acheive this?
 
Last edited:
blue_harvester said:
Take the following HTML code:
Code:
...
<a tooltiptext="The content of the tooltip" onmouseover="someFunction(tooltiptext);" href="#">Link</a>
...
Within IE the above code works perfectly in that the tooltiptext attribute can be passed straight into the someFunction function simply by stating it's name. However this does not work in Firefox. I have tried this.tooltiptext but it just states 'undefined'. How can I acheive this?
Anyone? Surely there is some way to do this?
 
Back
Top Bottom