-6

I want to bind a class to tr using jQuery. tr looks as below:

<tr id="@item[1]">
    <td>@item[0]</td>
    <td>@item[1]</td>
</tr>

after loading the data above tr looks as below:

<tr class="even" id="1">
    <td>AAA</td>
    <td>BBB</td>
</tr>

here i want to add one more class "read_only" to my tr as below:

<tr class="read_only even" id="1">
    <td>AAA</td>
    <td>BBB</td>
</tr>

how to do this in jQuery?

Mohammad
  • 21,175
  • 15
  • 55
  • 84
user1893874
  • 823
  • 4
  • 15
  • 38

1 Answers1

0
$(".even").addClass("read_only")
Trug
  • 322
  • 2
  • 14