html中<button>与<input type="button">区别
2014-04-24 16:33
477 查看
今天在html文本form表单中放了一个<button>标签,然后对按钮的关联了点击事件,在点击代码中,使用ajax向服务器请求数据,得到的结果老是刷新页面,真是百思不得其解,
终于一番摸索,终于发现:
1. IE下,button标签的默认行为是submit,相当于<input type=submit>,如果放在form表单中,就会进行提交操作,这是ajax就会无效。
2.在非IE下,button的行为正常了。
3.可以设置type属性来解决提交问题。
更详细参考: http://www.cnblogs.com/purediy/archive/2012/06/10/2544184.html
终于一番摸索,终于发现:
1. IE下,button标签的默认行为是submit,相当于<input type=submit>,如果放在form表单中,就会进行提交操作,这是ajax就会无效。
2.在非IE下,button的行为正常了。
3.可以设置type属性来解决提交问题。
更详细参考: http://www.cnblogs.com/purediy/archive/2012/06/10/2544184.html
相关文章推荐
- 解析<button>与<input type="button">的区别
- <button ></button>与<input type="button" />的区别
- <input type="button">与<asp:button>的区别,以及runat="server"的作用
- 解析<button>跟<input type="button"> 的区别
- <button>和<input type="button"> 的区别
- <input type="button">和<button>区别
- <button>与<input type="button">的区别
- HTML<button> 标签和<input type="button">的区别
- 解析<button>和<input type="button"> 的区别
- 解析<button>和<input type="button"> 的区别
- HTML<button>和<input type="button"> 的区别
- 解析<button>和<input type="button"> 的区别
- 解析<button>和<input type="button"> 的区别
- <button>和<input type="button"> 的区别
- HTML<button>和<input type="button"> 的区别
- <button>和<input type="button"> 的区别
- <input type="image"> 和 <img> 用法区别
- <input type = "submit"> 提交方式和用js的form.submit()有什么区别?
- <button>和<input type="button"> 的区别
- <button>和<input type="button"> 的区别