日期:2014-05-17  浏览次数:20735 次

javascript怎么给文本框赋值?
<input type="text" id="reportInfo_file" name="reportInfo_file" value="${reportInfo.file}"/>

现在我要通过JavaScript给这个文本框赋值,按照正常的赋值方式例如:

$("#reportInfo_file").attr("value","123");

传到后台时将reportInfo.file将变为空值,请教各位大神,有什么好的解决方法么?
javascript Java?web' java?web

------解决方案--------------------
$("#reportInfo_file").val(123);
------解决方案--------------------
jquery的赋值用
$("#reportinfo_file").val(123);