解决方法就是不传参,把值赋给其他属性
当然你是纯字符串没有数字可以试用转二进制进行传参
有什么更好的办法欢迎留言,大家一起交流
<a id="aa" name="bb" onclick="test(event, this)">aaa</a>
<script>
function test(event, elm) {
alert(elm.getAttribute("id"));
alert(elm.getAttribute("name"));
alert(elm.name);// html5
}
</script>