A
ajschuster
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)
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)