求各位大哥大姐指教,小弟初学者!
<script language=javascript>
var number = Math.random();
number = Math.ceil(number * 100);
document.write(number);
</script>
请问可以在<input type="text" value="???">
value中调用上面的js吗?
如何调用,求指教!
[解决办法]
<html> <head></head> <body> <input id="num" style="text-align: center" type="text"> <script language=javascript> document.getElementById("num").value=Math.ceil(Math.random()*100); </script> </body></html>