Here’s some sample code to explain what I’m trying to do:
<div id="list_subpanel_contacts">
<table>
<tbody>
<tr></tr>
<tr class="oddListRowS1"></tr>
</tbody>
</table>
</div>
<div id="list_subpanel_accounts_usi_orders">
<table>
<tbody>
<tr></tr>
</tbody>
</table>
</div>
<div id="list_subpanel_orders">
<table>
<tbody>
<tr></tr>
<tr class="oddListRowS1"></tr>
<tr class="evenListRowS1"></tr>
</tbody>
</table>
</div>
I need to find any div with an id starting with “list_subpanel_”, and doesn’t have any <tr> tags that have a class of either “oddListRowS1” or “evenListRowS1”.
Then I need to get whatever is after the second underscore in the div’s id and pass that to a function.
So, in the code example, the jQuery would find just the second div and pass “accounts_usi_orders” to the function.
This is pretty far beyond my current jQuery selection knowledge, so I’d appreciate any help, guys. Thanks!
You can use filter() with find():
To extract the
idfragment, you can use substr():