直接传递2个参数。
示例:
1、定义一个js方法
<script>
function trans(Y){
console.log(Y);
}
</script>
2、onclick传参
<button type="button" onclick='trans("X")'>传参</button>
这只是一个简单的小样例,仅供抛砖引玉。
直接传递2个参数。
示例:
1、定义一个js方法
<script>
function trans(Y){
console.log(Y);
}
</script>
2、onclick传参
<button type="button" onclick='trans("X")'>传参</button>
这只是一个简单的小样例,仅供抛砖引玉。
转载于:https://my.oschina.net/ZhenyuanLiu/blog/1834020