简体   繁体   中英

How to append one more class to exisiting one in Jquery

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?

$(".even").addClass("read_only")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM