JavaScript 参数调用 【每日一段代码51】

<html>
<head>
<script type="text/javascript">
function canshu(txt)
{
alert(txt);
}
</script>
</head>
<body>
<form>
<input type="button" onclick="canshu('蛋疼')" value="调用参数">
</form>
<p>通过点击这个按钮,可以调用一个带参数的函数。该函数会输出这个参数。</p>
</body>
</html>

原文地址:https://www.cnblogs.com/naokr/p/2403984.html