為什么運行不了?。?/h1>
<!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 hdjg(){
??????????? //定義接受關注JS進階篇判斷值的變量
??????? var message=confirm("是否關注JS進階篇?");
??????? alert(message);
????? if(message==true)
????? {
??????????? document.write("已關注JS進階篇!");
??????????? //定義接受關注JS高級篇判斷值的變量
??????????? var messages=confirm("是否關注JS高級篇!");
??????????? if(messages==true)
??????????? {
??????????????? document.write("已關注JS高級篇!");
??????????? }
??????????? else
??????????? {
??????????????? alert("選擇錯誤!請刷新頁面重新選擇!!");
??????????? }
??????? }
??????? else
??????? {
??????????? alert("選擇錯誤!請刷新頁面重新選擇??!");
??????? }
?????? }
??? </script>
</head>
<body>
??? <input type="button" id="ss" value="試一試" onclick="hdjg()"/>
</body>
</html>
<!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 hdjg(){
??????????? //定義接受關注JS進階篇判斷值的變量
??????? var message=confirm("是否關注JS進階篇?");
??????? alert(message);
????? if(message==true)
????? {
??????????? document.write("已關注JS進階篇!");
??????????? //定義接受關注JS高級篇判斷值的變量
??????????? var messages=confirm("是否關注JS高級篇!");
??????????? if(messages==true)
??????????? {
??????????????? document.write("已關注JS高級篇!");
??????????? }
??????????? else
??????????? {
??????????????? alert("選擇錯誤!請刷新頁面重新選擇!!");
??????????? }
??????? }
??????? else
??????? {
??????????? alert("選擇錯誤!請刷新頁面重新選擇??!");
??????? }
?????? }
??? </script>
</head>
<body>
??? <input type="button" id="ss" value="試一試" onclick="hdjg()"/>
</body>
</html>
2018-12-23
我直接復制的,可以運行的,就是還有就是聲明的方式是html4的,用html5與時俱進
<!DOCTYPE html>
<html>
.......