Sunny wrote:
Hi I have a div called shape on my page.
When I try to get its length using javascript in IE, everything works
fine.
But When I try it in Firefox it has element has no properties.
Here is the code that I am using.
var shps = document.getElementsByTagName("shape");
lastshp = shps.length
alert ("there are currently: " + lastshp + " shapes")
In IE It returns 2.
But In Firefox it returns 0.
Why what i am doing wrong here.
("My neighbor has a big car, I don't. What I am doing wrong here?")
Posting in gibberish, coding cluelessly, or both. A `div' is not a `shape',
`shape' is not an HTML element, the tag name (type) of an element is not the
name of this element, and you have provided too little information about
your markup or the position of your script code for an educated guess anyway.
<http://jibbering.com/faq/#FAQ2_3>
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee