How to show/hide ALL objects with a certain id?

K

KathyB

Hi, I'm using a simple show function, called from a button.

function show(rowId) {
var hideRow = "View_" + rowId
document.getElementById(showRow).style.display ="block";
}

QUESTION: I'm using xsl and can have more than one table row with the
specific rowId, and I want ALL of them to show when the button is
clicked for that rowId. But although the html source is there, I only
get the first row with the rowId.

New to this...where am I going wrong please.

Thanks, Kathy

p.s. IE 5.5 used only on intranet...so no cross browser needed.
 
H

Hywel Jenkins

Hi, I'm using a simple show function, called from a button.

function show(rowId) {
var hideRow = "View_" + rowId
document.getElementById(showRow).style.display ="block";
}

QUESTION: I'm using xsl and can have more than one table row with the
specific rowId, and I want ALL of them to show when the button is
clicked for that rowId. But although the html source is there, I only
get the first row with the rowId.

New to this...where am I going wrong please.
You can't have more than one object with a particular ID. IDs are
unique. Set the rows to have the same class and parse the DOM looking
for the class that matches your criteria.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top