[UPHPU] javascript syntax

Merrill Oveson moveson at gmail.com
Mon May 2 10:41:46 MDT 2011


phpers:

struggling with this....


This works:

var rowDisplay = document.getElementById('tr_1').style.display;


How do I put the tr_ into a for loop?

i.e.

for(var j=0; j<10; j++) {
       var rowDisplay = eval("document.getElementById('tr_'" + j +
").style.display";
       alert ("display is " + rowDisplay);
 }


or
var rowDisplay = document.getElementById['tr_' + j].style.display;

?

I'd prefer not to use the eval if I don't have to.

Thanks

Merrill


More information about the UPHPU mailing list