NEED HELP!! Firefox not recognizing the "name" property?!?!?!
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

NEED HELP!! Firefox not recognizing the "name" property?!?!?!

From: <ajschuster@gmail.com>
Date: Fri Apr 07 2006 - 09:38:58 CEST

I cannot get my Javascript to work in Firefox. I am just trying to
access the .name property of a DIV tag but it keeps coming back as
"undefined". The same code works in IE and it works in Safari.... and
if I change it to .id instead of .name it can read that so why wouldn't
it be able to read the .name?

I need urgent help!! Here's my code....

    var item = null;

    if (document.body.getElementsByTagName) {
      item = document.body.getElementsByTagName('DIV');
    } else if (document.body.all) {
      item = document.body.all.tags('DIV');
    }

    // normally this next part is in a for loop that goes through the
whole array. each time it comes back as undefined
    alert("Variable: " + item[4].name)
Received on Mon May 1 04:47:31 2006