為什么我的按鈕點(diǎn)一下就消失了
<!DOCTYPE?html> <html> <head> <meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/> <title>Math?</title> <script?type="text/javascript"> ????function?myrandom() ????{ ????????document.write(Math.round(Math.random()*10)) ????} ????document.write(Math.round(Math.random()*10)) </script> </head> <body> ????<form> ????<input?type="button"?value="獲取隨機(jī)整數(shù)"?onclick="myrandom()"> ????</form> </body> </html>
2017-09-07
你把中間代碼換成這個(gè),可能是由于document.write ?方法把按鈕覆蓋了吧!這種情況我也沒有遇到過,奇怪 奇怪?