实例代码“Ctrl+/”提示“F11/ESC”全屏 返回 格式化 恢复 运行
x
 
1
<!DOCTYPE html>
2
<html> 
3
<head> 
4
<script> 
5
function myfunction(txt) 
6
{ 
7
alert(txt);
8
} 
9
</script> 
10
</head> 
11
12
<body> 
13
<form> 
14
<input type="button" 
15
onclick="myfunction('Good Morning!')" 
16
value="In the Morning"> 
17
18
<input type="button" 
19
onclick="myfunction('Good Evening!')" 
20
value="In the Evening"> 
21
</form> 
22
23
<p>
24
When you click on one of the buttons, a function will be called. The function will alert
25
the argument that is passed to it.
26
</p>
27
28
</body> 
29
</html> 
30
31