<!DOCTYPE html><html><head>? ? <meta charset="UTF-8"><title>JS</title><script type="text/javascript">? ? ? ? function rec(){? ? ? ? ?var bzd;? ? ? ? ?bzd=prompt("你家房子值多少錢?單位:W");? ? ? ? ?if (bzd>=1000) {? ? ? ? ?document.write("很好,土豪")? ? ? ? ?};? ? ? ? ?else if (bzd>=100) {? ? ? ? ?document.write("還算富有")? ? ? ? ?};? ? ? ? ?else if (bzd>=10) {? ? ? ? ?document.write("回家學(xué)習(xí)吧")? ? ? ? ?};? ? ? ? ?else? ? ? ? ?{? ? ? ? ?document.write("回家努力看書改變?nèi)松?)? ? ? ? ?}? ? ? ? }</script></head><body><input type="button" value="看你是不是土豪" onClick="rec()" name="button"></body></html>
幫忙看一下,自己寫的代碼,仔細(xì)看了很多遍,還是彈不出消息框,謝謝
popping小泓
2015-12-05 20:21:48