テキストボックスに乱数を入力しようとしています現在、1つのテキストボックスで試しています。イベントの読み込み時に、javascript を使用してテキスト ボックスに乱数を入力します。
<script type="text/javascript">
function Random()
{
return Math.floor(Math.random() * 10);
}
</script>
<form name="f1">
a= <input type="text" name="field1" /></br>
b= <input type="text" name="field2" /></br>
Answer: <input type="text" name="ansfield" />
<input type="button" value="Fill" onload()="document.getElementById('field1').value=Random()"/>
</form>