案例:javascript案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<p>请点击其中的一个按钮,来调用带参数的函数。</p>
6
7
<button onclick="myFunction('Harry Potter','Wizard')">点击这里</button>
8
<button onclick="myFunction('Bob','Builder')">点击这里</button>
9
10
<script>
11
function myFunction(name,job)
12
{
13
alert("Welcome " + name + ", the " + job);
14
}
15
</script>
16
17
</body>
18
</html>
19