当我点击Button时,我想将输入文本值更改为'hello',但它似乎不起作用,这里是我的代码。优点请帮助我真的小白,先谢谢了!使用javascript更改窗体内部输入文本的值
<script type="text/javascript">
function selectfile(){
document.uploadform.selectfile.value='hello';
}
</script>
<body>
<form name="uploadform" id="uploadform">
<input type="text" name="selectfile" id="selectfile" value="Hi"/>
<input name="upload_file" type="button" onClick="selectfile()" value="Button"/>
</form>
</body>
你得到了什么错误?你知道开发者控制台(在Firefox或铬的F12)吗? – mindandmedia 2012-07-21 20:49:32
我得到了:Uncaught TypeError:对象不是函数 O__O – user1543198 2012-07-21 21:02:41