怎么能點擊按鈕才填出文字啊
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函數(shù)調用</title>
? ?<script type="text/javascript">
? ? ? ?function contxt() //定義函數(shù)
? ? ? {
? ? ? ? ?alert("哈哈,調用函數(shù)了!");
? ? ? }
? ? ? contxt();
? ?</script>
</head>
<body>
? ?<form>
? ? ? <input type="button" ?value="點擊我" onclick=" ? ?" /> ?
? ?</form>
</body>
</html>
2017-10-23
你第十行里
?contxt();
這已經在script里面調用過了。
?在15行里
<input type="button" ?value="點擊我" onclick=" ? ?" />?
onclick=" ? ?"," ?"里面可以寫函數(shù)調用!
2017-10-17
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>函數(shù)調用</title>
? ?<script type="text/javascript">
? ? ? ?function contxt() //定義函數(shù)
? ? ? {
? ? ? ? ?alert("哈哈,調用函數(shù)了!");
? ? ? }
? ?</script>
</head>
<body>
? ?<form>
? ? ? <input type="button" ?value="點擊我" onclick="contxt()" /> ?
? ?</form>
</body>
</html>
2017-10-17
<form>...</form>里面定義了按鈕提示,點擊后的內容就是function定義的函數(shù)里的