阻止表单提交
<form action="http://www.baidu.com" >
<input type="submit" value="提交" name="sub" οnclick="tap(event)">
</form>
注意:这里不能直接 用tap(),必须带参数
function tap(event){
console.log(arguments);
event.preventDefault()
}
补充:自定义的属性只能通过getAttribute函数获取到