<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>JavaScript函数传递参数</title>
</head>
<body>
<p>请点击其中的一个按钮,来调用带参数的函数。</p>
<button onclick='javascript:myFunction('Harry Potter','Wizard');return false;'>点击这里</button>
<button onclick="myFunction('Bob','Builder')">点击这里</button>
<script>
function myFunction(name,job)
{
alert("Welcome " + name + ", the " + job);
}
</script>
</body>
</html>