日期:2014-05-16  浏览次数:20358 次

jquery $("del0 > input[name='costPrice']").val("123")给一个单元格赋值出错
有一个表
HTML code

<table>
    <tr id="del0">
        <td align="center"><input type="text" name="costPrice"/></td>
    </tr>
    <tr id="del1">
        <td align="center"><input type="text" name="costPrice" /></td>
    </tr>
</table>



我想用$("del0 > input[name='costPrice']").val("123");这条语句给第一行的单元格中的一个text框赋值,但是赋值不成功,这条赋值语句该怎么写呢?

------解决方案--------------------
$("#del0 td input[name='costPrice']").val("123")