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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changind Class onclick

Status
Not open for further replies.

lazytrucker

Programmer
Aug 4, 2004
39
GB
Hi I am trying to change the classname of an object by id.
The objects and id is created in a loop however all id's are unique and passed to the change function onclick.

the process for change is:

ident=cl+seg+rec;
alert(ident)
document.getElementByid(ident).className='textRed';

The type of element is a font tag and the error returned is:
"Object doesnt support this property or method", but when using:
onclick="this.className='textRed';
on a font element it works fine any quesses as to why this is happening.

Cheers lazytrucker

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top