亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

沒有按鈕 怎么搞 錯了嗎

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>我們互動下</title>

<script type="text/javascript">

? ? function rec() {

? ? ? ? var message=confirm("JS進階篇");

? ? ? ? if message==true{

? ? ? ? ? ? document.write("關注JS高級篇");

? ? ? ? }

? ? ? ? else{

? ? ? ? ? ? document.write("煞筆別瞎點");

? ? ? ? }

? ? }

</script>

</head>

<body>

? ?<p id="con">JS進階篇</p>

? ?<form>

? ? ? ?<input type="botton" onclik="rec()" value="你敢點嗎"/>

? ?</form>

</body>

</html>


正在回答

1 回答

?if?message==true{

這里if后面差個()

if?(message==true){
<input?type="botton"?onclik="rec()"?value="你敢點嗎"/>

這里按鈕寫錯了,是button不是botton;點擊事件是onclick不是onclik

<input?type="button"?onclick="rec()"?value="你敢點嗎"/>

修改后的代碼

<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html?xmlns="http://www.w3.org/1999/xhtml">
<head>
????<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8"?/>
????<title>我們互動下</title>
????<script?type="text/javascript">
????????function?rec()?{
????????????var?message=confirm("JS進階篇");
????????????if?(message==true){
????????????????document.write("關注JS高級篇");
????????????}
????????????else{
????????????????document.write("煞筆別瞎點");
????????????}
????????}
????</script>
</head>
<body>
<p?id="con">JS進階篇</p>
<form>
????<input?type="button"?onclick="rec()"?value="你敢點嗎"/>
</form>
</body>
</html>


0 回復 有任何疑惑可以回復我~
#1

qq_小Lun_0 提問者

還是要多問問大神,這些錯誤感覺自己看不出來,謝謝老師
2015-08-17 回復 有任何疑惑可以回復我~
#2

Perona 回復 qq_小Lun_0 提問者

我也是童鞋誒~~
2015-08-17 回復 有任何疑惑可以回復我~
#3

qq_小Lun_0 提問者 回復 Perona

會的比我多的都是我老師,剛學沒多久
2015-08-17 回復 有任何疑惑可以回復我~
#4

Perona 回復 qq_小Lun_0 提問者

都是童鞋,相互學習吧~~
2015-08-17 回復 有任何疑惑可以回復我~
#5

qq_小Lun_0 提問者

非常感謝!
2015-08-17 回復 有任何疑惑可以回復我~
查看2條回復

舉報

0/150
提交
取消

沒有按鈕 怎么搞 錯了嗎

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號