1
<p>点击这个按钮,来调用带参数的函数。</p>
2
<button onclick="myFunction('Harry Potter','Wizard')">点击这里</button>
3
<script>
4
function myFunction(name, job) {
5
alert("Welcome " + name + ", the " + job);
6
}
7
</script>
<p>点击这个按钮,来调用带参数的函数。</p>
<button onclick="myFunction('Harry Potter','Wizard')">点击这里</button>
<script>
function myFunction(name, job) {
alert("Welcome " + name + ", the " + job);
}
</script>