编辑下面的代码:【加编码】
<html> <body> <p>请点击其中的一个按钮,来调用带参数的函数。</p> <button onclick="myFunction('Harry Potter','Wizard')">点击这里</button> <button onclick="myFunction('Bob','Builder')">点击这里</button> <script> function myFunction(name,job) { alert("Welcome " + name + ", the " + job); } </script> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂