Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I feel like I'm chasing my tail on

Status
Not open for further replies.

rubychyld

Programmer
Mar 22, 2001
76
US
I feel like I'm chasing my tail on this... hope someone can help. I am trying to loop through all the span tags on my asp page by using the following...

var objSpans = document.all.tags("span");
alert(objSpans.length)

however this alert returns "0". I know this is not true, and I've tried it with other common tags like "p" and "td" etc. and still returns "0".

how do I assign all the span tags to an object?

Thanks a million, Liz Catch the vigorous horse of your mind!
 
Not sure which browsers this works in, but I use:

spans_array = document.getElementsByTagName("SPAN"); jared@eae.net -
 
hi rubychyld be shure 2 call this function onload..
function spanlength(){
var objSpans = document.all.tags("span");
alert(objSpans.length)
}
onload=spanlength

or after ur spans, not in the very begining of ur page (that was my main error - callin such things in the body tag, in the process of page parsing..)
regards, vic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top