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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -