I'm trying to trigger a javascript onMouseOver event without having the onMouseOver attribute on everyone of my anchor attributes. In reality I want to display some other anchors when the user mouses over an element, but I can't even get an alert to work. I keep getting the error of:
Uncaught TypeError: Cannot call method 'getElementsByTagName' of null
Which doesn't make sense to me because if I alert out the getElementById()
I end up with a DIV element, which it should then get all the anchor tags inside that div element... Not sure what I am missing.
JSFiddle Link: http://jsfiddle.net/NfTtq/
Also note I am doing this Javascript not JQuery :S
tag.. this way the code is only found after all elements in the page and they exist when the code is executed. `$(document).ready(fn)` is jQuery, there is no cross browser equivalent in plain javascript.
– Esailija Nov 17 '11 at 16:53` tag you put `` and inside the script tag you put the code and it should work.
– Esailija Nov 17 '11 at 17:02