jquery赋值<id="process_in_desc_@a" type="text">



                                            <input name="process_in_set_@a" id="process_in_set_@a" type="hidden">
                                        </td>
                                        <td>
                                            <span class="xc1">不符合条件时的提示</span>
                                        </td>
                                    </tr>

我在js中给id=process_in_desc_@a赋值,
$("input[id='process_in_desc_@a']").val("hello"); 无法赋值,但是测试过这个语句有用,为什么没法赋值啊,这个id这时候不是代表这个text么

id不能重复,既然都有id了,直接用id选择器啊

 $("#process_in_desc_@a').val("hello");

可能1:input类型是hidden,已经赋值了,但你看不出
可能2:你没有引用jquery文件

输出选出的对象长度看看,是不是id重复了,设置到其他控件的去了,而不是你需要设置的

 alert($("input[id='process_in_desc_@a']").length)

可能3:jquery选择器里应该不支持有@。你可以用F12看下,有@会出错

ID一般不建议用@,前端的调试,你都可以按F12,进入控制台调试