浏览器支持
所有主流浏览器都支持
重要事项:如果在HTML表单中使用button元素,不同的浏览器会提交不同的值。InternetExplorer将提交
注意事项
在使用
1、通过$('#customBtn').val()获取
在IE(IE内核)下这样用到得的是值是“按钮”,而不是“test”,非IE下得到的是“test”。参加上面标红的第一句话。
这一点要和
通过这两种方式$('#customBtn').val(),$('#customBtn').attr('value')在不同浏览器的获得值,如下:

验证这一点可以在测试下面的代码
<metahttp-equiv></metahttp-equiv>
<scripttype>
<scripttype>
$(function(){
$('#test1').click(function(){
alert($('#customBtn').attr('value'));
});
$('#test2').click(function(){
alert($('#customBtn').val());
});
});
<buttonid>按钮
<inputtype></inputtype>
<inputtype></inputtype>
</buttonid></scripttype></scripttype>
2、无意中把
<formaction> <button>button</button> <inputtype></inputtype> <inputtype></inputtype> </formaction>











