jquery - table rows as dropdown -
i have html table. im trying add functionality such when click on row should display set of row, drop down menu. have done following,
<table> <tr class="clicker"> <td>some data</td> </tr> <tr class="hidden"> <td>some new data here</td> </tr> </table>
$(".clicker").on("click", function () { if ($(this).next().hasclass("down")) { $(this).next().slideup("normal").removeclass("down"); } else { $(this).next().slidedown("normal").addclass("down"); } });
when trying add second , third row in hidden rows like:
<table> <tr class="clicker"> <td>some data</td> </tr> <tr class="hidden"> <td>some new data here</td> </tr> <tr class="hidden"> <td>some more data here</td> </tr>
, doesn't work. did wrong?
see example.
$('.clicker').click(function(){ $(this).nextuntil('.clicker').slidetoggle('normal'); });
it toggles several rows. can have several clicker way.
Comments
Post a Comment