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

setting cell contents to bold 1

Status
Not open for further replies.

mattquantic

Programmer
Mar 28, 2004
196
GB
Hi, I have a function that highlights a cell using:

Code:
   function highlightTableCell( cellName , color )
   {
      document.getElementById( cellName ).style.backgroundColor=color;

   }

But, when I try to change the color of the text or bold it will not let me:

Code:
   function highlightTableCell( cellName , color )
   {
      document.getElementById( cellName ).style.backgroundColor=color;
      document.getElementById( cellName ).style=font-weight='bold';   
      document.getElementById( cellName ).style.cursor='hand';   
      document.getElementById( cellName ).style.color='#ffffff';         
   }

Is my syntax wrong or something?

M@?
 
try
Code:
      document.getElementById( cellName ).style.fontWeight='bold';

hope that helps out

"Whether you think that you can, or that you can't, you are usually right." - Henry Ford
 
also i think you could make general style classes and use style.className = "class1" on mouse over and on mouseout style.className = "class0" ( back to normal )

[thumbsup2]DreX
aKa - Robert
 
opos .. not style.className it's pageobj.className like :

document.hyperlinkA.className

[thumbsup2]DreX
aKa - Robert
 
Sorry, so I could use:

document.#theelementid#.className ='#MyClass#';

?
 
so I can use?

document.MyElementID.className ='MyClass';

?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top