confirm 為什么點(diǎn)擊對話框不會(huì)彈出窗口?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>confirm</title>
? <script type="text/javascript">
? function rec(){
? ? var mymessage=confirm("你是男士還是女士?);
? ? if(mymessage==true)
? ? {
? ? document.write("你是女士!");
? ? }
? ? else
? ? {
? ? ? ? document.write("你是男士!");
? ? }
? }
? </script>
</head>
<body>
? ? <input name="button" type="button" onClick="rec()" value="點(diǎn)擊我,彈出確認(rèn)對話框" />
</body>
</html>
2017-05-19
js語法錯(cuò)誤了啊,你confirm里邊的字符串沒有用后引號完整借宿,這要是在編輯工具會(huì)直接有提示語法錯(cuò)誤的~
還是要細(xì)心
2017-05-19
少個(gè)引號好吧