1

I have a simple table, and I would like to add a class for the cells between the active class.

<table>
<tr>
    <td class="active">col</td>
    <td>col</td>
    <td>col</td>
    <td>col</td>
    <td>col</td>
</tr>
<tr>
    <td>col</td>
    <td>col</td>
    <td>col</td>
    <td class="active">col</td>
    <td>col</td>
</tr>
</table>

The problem is that the second active col is in a new tr. How can I achieve the expected functionality?

user1452062
  • 805
  • 4
  • 12
  • 27
  • 1
    **Disclaimer: I wrote this plugin** - You can use my nextInDOM plugin with a simple while loop to achieve this - Demo: http://jsfiddle.net/xxg48zfy/ (The red ones are `.active`, the blue ones are the ones on whom the new class was added) – techfoobar Jul 19 '15 at 07:45
  • 1
    You're welcome. :) Please don't link to the script directly as done in the fiddle - as it is from a production site of mine. Please copy the code in the JS file and serve from your own server. Thanks. – techfoobar Jul 19 '15 at 08:11

0 Answers0