求問 里面的mymessage是什么
var mymessage=confirm("你是妹子嗎") ;
? ? if(mymessage==true)
? ? {
? ? document.write("你是女士!");
? ? }
? ? else
? ? {
? ? ? ? document.write("你是男士!");
? ? }
? } ? ?
? </script>
</head>
<body>
? ? <input name="button" type="button" onClick="rec()" value="點擊我,彈出確認對話框" />
</body>
</html>
2016-03-05
mymessage是confirm()函數(shù)的返回值,如果你點了確認那就是true點了取消就是false
2016-03-05
confirm("你是妹子嗎") 轉換成的布爾值賦給了變量mymessage,說白了就是一個自定義的變量
2016-03-05
定義的一個函數(shù)名。