-1
$("td").className='';

Trying to do something like this where it makes all the <TD> elements the requested css class. I don't even know if thats the proper way to do it.

Jake
  • 1,469
  • 4
  • 19
  • 40

2 Answers2

4

You want to use addClass():

$('td').addClass('yourClassName');
mVChr
  • 49,587
  • 11
  • 107
  • 104
  • Thank you very much, not used to using $() for elements and such. I'll mark this as accepted when it lets me. – Jake Jun 30 '12 at 00:08
2

Or you can use attr().

$('td').attr('class', 'className');
Derek 朕會功夫
  • 92,235
  • 44
  • 185
  • 247
DamianS1987
  • 302
  • 1
  • 3
  • 13