Changeing Table Color

< script >
function TbClr(redid)
{
if (redid=='test1')document.getElementById (redid).style.backgroundColor='red';
if (redid=='test2')document.getElementById (redid).style.backgroundColor='Green';
}
< /script >
< /head >
< body >
< form id="form1" runat="server" >
< table border ="1" cellpadding ="0" cellspacing ="0" style ="cursor:pointer;" >
< tr onclick ="TbClr(this.id);" id='test1' >
< td >A1< /td >
< td >A123< /td >
< /tr >
< tr onclick ="TbClr(this.id);" id='test2' >
< td >B1< /td >
< td >B123< /td >
< /tr >
< /table >


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: