<input type ="button"></input>和<button></button>在mvc中的区别

时间:2014-08-13 12:47:46   收藏:0   阅读:241

今天整了一上午,在MVC3中的form表单中放一个<button></button>一触发button中的onclick事件尽管没submit但仍然会提交表单(提交地址是默认传过来的地址一般为/ControllerName/Index)而<input type="button"></input>则不会

无意中把<button>标签放到了<form>标签中,你会发现点击这个button变成了提交,相当于<inputtype="submit"/>  

Internet Explorer 的默认类型是 "button",而其他浏览器中(包括 W3C 规范)的默认值是 "submit"。

<input type ="button"></input>和<button></button>在mvc中的区别,布布扣,bubuko.com

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!