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!

How come this doesn't work? 1

Status
Not open for further replies.

snoopy75

Technical User
Aug 24, 2001
340
US
I'm trying to create an "Expand All" button that, when clicked, will show a bunch of rows that were previously hidden. Here's the code I'm using, but it does absolutely nothing. How come?
Code:
var arrRows = document.getElementsByTagName("td");
	
for (var i=0; i < arrRows.length; i++) {
	if (arrRows[i].id.substr(0,9) == "infoOwner") {
		arrRows[i].style.display = '';
	}
}

--Ryan
 
Aren't the ROWS the ones with initial display equal to none?

Wouldn't you want to get the TR's, not the TD's?

I just tried a test, and when I gave the <tr> tags id's of infoOwner1 - infoOwner5, then ran this function with TR instead of TD it worked fine.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
oh, jeez... You're right, good catch. I feel kinda dumb now. It must be early Friday morning. [morning]

--Ryan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top