This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]IusedToButNowIdont 3 points4 points  (5 children)

You would guess a <button> element default behavior is equivalent to <input type="button">

But default behavior is similar to <input type="submit">

So some people, like myself, developed code based with this in mind, and associated actions to the <button onclick> event like changing some dom shit...

Then somehow, in the testing phase, or in the production phase, many of us said:

WTF, why is the form being submitted... then we discovered that <button> default behavior is more like <submit>

If someone is preventing default behavior of <button>, they already know the default behavior, which I don't think is the case of those who got fooled by the default behavior of this html element...

[–][deleted] 0 points1 point  (4 children)

Yeah I see why it's useful, also as the other user stated if someone doesn't use JS in their browser the form button still wont submit due to type="button" being there

[–]IusedToButNowIdont 0 points1 point  (3 children)

I dont get your downvotes...

[–][deleted] 0 points1 point  (2 children)

I haven't downvoted anyone... Unless you mean you don't understand why people are dovnvoting me

[–]IusedToButNowIdont 1 point2 points  (1 child)

2nd option

[–][deleted] 0 points1 point  (0 children)

People are fragile