View Full Version : short script throws error plz advise.

10-15-2005, 04:45 PM
Hello folks,

Its a while since I have been in here asking for your help but I am stumped with this especially because it is used only to make IE perform and it is oly that browser which throws up the error. :rolleyes:

<script type="text/javascript"><!--//--><![CDATA[//><!--

sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\\\b"), "");
if (window.attachEvent) window.attachEvent("onload", sfHover);


this is the error I am shown by IE6win

error: 'document.getElementById(...) ' is null or not an object

Any tips appreciated


10-15-2005, 05:16 PM
I'm guessing you are trying to make IE use li:hover, read this article (http://www.alistapart.com/articles/horizdropdowns). They already have a script that does this quite well.