3.2.0

getelementbyid

i am trying to do this. no luck. can any1 pls help:

var elem = document.body.getElementsByTagName('*');
var str = "";
var s = 0;

for(i=0; i<elem.length; i++)
{
ElementNow = elem(i).id;
ProperID = ElementNow.substring(0, (ElementNow.length - 9));
if(elem(i).type == 'text')
{
ProperID = document.getElementById(ProperID);
ElementNow.setControlDisabled(true);
ProperID.setStyle('color', 'red');
}
}

basically, get all elements from the page. for each text element, apply color red
t4
March 4,
I think you need to refer to the elements in the elem array using elem[i], not elem(1).
Chris Pamplin
March 5,
no luck. perhaps, just an alternate way of doing same thing.
t4
March 8,

This topic is archived.

See also:


Back to support forum