from中buttone 和 input type="button" 区别

在做一个表单提交时碰到的问题,

1、js判断阻止表单提交,如果是form 里面的button的话,恭喜你,你要再换个写法了。<button type="submit" ....></button> 要改写为 <input type="button" onclick="submit()">,当然onclick函数自己写,各种判断在这个函数submit中实现。

2、form表单中的button效果相当于<input type="submit" >。具体代码不写了,可以参考此链接

posted @ 2018-11-30 17:10  尘世书童  阅读(374)  评论(0)    收藏  举报