0

I have a table, like below, and I want to add an event of the click of any tr with the class = hover.

Before the need to include the hover class, this worked: $('#delegation tbody tr'); now, I feel like I've tried placing .hover in every imaginable location within that selector, but can't seem to get it.

<table id="delegation">
  <tbody>
    <tr class="hover">
        <td>

        </td>
    </tr>
    <tr>
        <td>

        </td>
    </tr>
</tbody>

4

3 回答 3

2

尝试:

$('#delegation tbody tr.hover')
于 2013-07-05T14:46:42.333 回答
0

如果我了解您在寻找什么:

$('#delegation').find('tr.hover').on('click',function(){...});
于 2013-07-05T14:41:56.143 回答
0

你可以使用这个:

$('tr.hover', $('#delegation'))
于 2013-07-05T14:41:19.113 回答