javascript - closest/next div selecting jquery -


i have html this:

<table>  <tr>   <td>     <button class="popup" id="$row[0]"></button>   </td>  </tr> </table>     <div class="details">    <div id="section-2">    </div>  </div> 

here goes jquery script:

    $(document).ready(function() {       $('.popup').click(function () {       // : $(this).next(".details").dialog('open');         $('.details').dialog('open');         });       });     }); 

i want dialog closest/next div class details

the details element next sibling of table element, use .closest() find table ancestor of button use .next() find details element

$(document).ready(function () {     $('.popup').click(function () {         // : $(this).next(".details").dialog('open');         $(this).closest('table').next('.details').dialog('open');     }); }); 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -