沒有按鈕 怎么搞 錯了嗎
<!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>
2015-08-14
這里if后面差個()
這里按鈕寫錯了,是button不是botton;點擊事件是onclick不是onclik
修改后的代碼