<!DOCTYPE html>
<html>
<head>
<title>test5</title>
<script type="text/javascript">
function myFunction(name,job) {
alert("Welcome "+ name + ",the " + job);
}
</script>
<meta charset="utf-8">
</head>
<body>
<p>点击测试传递参数</p>
<button οnclick="myFunction('Bill Gates','CEO')">点击</button>
</body>
</html>
点击“点击”按钮后,将两个参数传递到myFunction函数里,通过alert函数显示出来