當我點擊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