<input type="button" name="sub" value=" 拆箱 " class="w3dButton" onclick='sub()'>如果name和javascript方法同名 就会报此属性方法或错误解决办法更改其中一个即可 ,原因不明