如何选择嵌套在td,classname和id名称中的输入?

时间:2014-08-07 18:06:20

标签: javascript jquery html

鉴于tr(rhel6-x86_64)的id名称,有没有办法选择带有类名的<input>&#34; dependency-tag&#34;?我试过了$('#rhel6-x86_64 td .dependency-tag'),但它没有用。感谢

<tbody id="target-body">
    <tr id="rhel6-x86_64">
        <td>rhel6-x86_64</td>
        <td>. set_env.sh; make bas</td>
        <td>../cucs-hud_1.5.0_out</td><td>../cucs-hud_1.5.0_log</td>
        <td><input class="dependency-tag"></td>
        <td>
            <button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-remove"></span></button>
            <button class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil"></span></button>
        </td>
     <tr>

1 个答案:

答案 0 :(得分:0)

您可以使用find方法选择所需的元素

$("#rhel6-x86_64").find("input.dependency-tag");