到底哪里出問題了
<script type="text/javascript">
? ?//我是單行注釋,我也要隱藏起來!
</script>
</head>
<body>
<inpute type="button" value="請點(diǎn)擊我" onclick="nice()">
? document.write("系好安全帶,準(zhǔn)備啟航");
? ?function nice(){
? ?var wether=comfirm("準(zhǔn)備好了嗎");
? ?if(wether==true)
? ?{document.write("讓我們起航吧");}
? ?else
? ?{document.write("繼續(xù)學(xué)習(xí)吧!");}
? ?}
2020-05-22
輸出語句和函數(shù)要在script 中定義,要不就是外部文件引用。不能在其他位置
2020-02-20
<body>
<form>
<input type="button" value="請點(diǎn)擊我" onclick="nice()">
</form>
<script type="text/javascript">
? document.write("系好安全帶,準(zhǔn)備啟航");
? ? function nice(){
? ? var wether=confirm("準(zhǔn)備好了嗎");
? if(wether==true)
? ? {
? ? document.write("讓我們起航吧");
? ? }else
? ? {
? ? document.write("繼續(xù)學(xué)習(xí)吧!");
? ? }
? ? }
? ?</script>
</body>