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