you could do:
for(var j=0; j<10; j++) {
var the_row = 'tr_' + j; // create the id field value
var rowDisplay = eval("document.getElementById(the_row).style.display";
alert ("display is " + rowDisplay);
}
I tried it on a webpage that uses mooTools and one that uses jQuery, it worked
on both.
javascript:(function(){target='*target_id*';alert(document.getElementById(target).innerHTML);})();
I'm pretty sure it will work in javascript with no added libraries.
Aaron
On May 2, 2011, at 9:41 AM, Merrill Oveson wrote:
> 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
>
> _______________________________________________
>
> UPHPU mailing list
> [email protected]
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
_______________________________________________
UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net