jquery $("del0 > input[name='costPrice']").val("123")给一个单
jquery $(del0 input[namecostPrice]).val(123)给一个单元格赋值出错有一个表HTML codetablet
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")