How to get all child inputs of a div element (jQuery) Ask Question

How to get all child inputs of a div element (jQuery) Ask Question

HTML:

<div id="panel">
  <table>
    <tr>
       <td><input id="Search_NazovProjektu" type="text" value="" /></td>
    </tr>
    <tr>
       <td><input id="Search_Popis" type="text" value="" /></td>
    </tr>
  </table>
</div>

I need to select all inputs in the particular div.

This's not working:

var i = $("#panel > :input");

ベストアンサー1

Use it without the greater than:

$("#panel :input");

The > means only direct children of the element, if you want all children no matter the depth just use a space.

おすすめ記事