Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove row class from table -Jquery

Tags:

html

jquery

I have a table .Table id is resultTable. Some of the rows in the table have a class.

How can i remove those classes from that table.

I am using the code given below to add the class

     $('#resultTable tr').click(function (event) {
       $(this).addClass("test");
       });

TO remove the class test from the entire table , i tried the code given below

   $('#resultTable').removeClass("test");

But its not working.Any ideas?

like image 941
Null Pointer Avatar asked Mar 01 '11 12:03

Null Pointer


1 Answers

You forgot a tr

$('#resultTable tr').removeClass("test");
like image 160
Andrea Avatar answered Sep 28 '22 07:09

Andrea