Here is the code snippet I am working with:
window.addEvent('domready', function() {
var li_list = document.getElementById("topmenu").getElementsByTagName("li");
for (var i=0; i<li_list.length; i++) {
li_list[i].onmouseover=function() {
this.className+=" hover";
}
li_list[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" hover\\b"), "");
}
}
})
However, I am running into an issue in IE7-8 where it fails with the message "document.getElementById(...) is null or not an object."
The code works perfectly fine in Firefox.
This problem directly impacts the functionality of the main menu on my website:
Your help on resolving this issue would be greatly appreciated. Thank you!