為什么對(duì)話框出不來?求解答,謝謝
<!doctype?html> <html> <head> ????<meta?http-equiv="Content-Type"?content="text/html";charest="gb2312"/> ????<title>函數(shù)調(diào)用</title> <script?type="javascript"> function?add() { alert("飄過"); } </script> </head> <body> <form> <input?type="button"?value="戳我"?onclick="add()"/> </form> </body> </html>
2015-12-09
<script?type="text/javascript">
type要寫對(duì),當(dāng)然html5也支持不寫
2015-12-15
因?yàn)槟氵€沒有調(diào)用函數(shù)add();定義好函數(shù)要要調(diào)用它
2015-12-13
script開始標(biāo)簽要這樣寫:<script?type="text/javascript">
或這樣寫:<script>
2015-12-09
<!doctype?html>
<html>
<head>
????<meta?http-equiv="Content-Type"?content="text/html";charest="gb2312"/>
????<title>函數(shù)調(diào)用</title>
????<script?type="javascript"><!--"text/javascript" ?可以不寫 ?一般瀏覽器都支持的--!>
????function?add()
????{
????alert("飄過");
????}
????</script>
</head>
<body>
????<form>
????????<input?type="button"?value="戳我"?onclick="add()"/>
????</form>
</body>
</html>