Q:

What does button type="button" mean in JavaScript

Whilst going through the W3 schools website I was trying to see what it meant when it said <button type="button" but I wasn't entirely sure. Could someone please explain to me what this means.

A:

A <button> tag can either be a plain <button> (when its type is "button") or a submit button (when its type is "submit", the default).
A "submit" button causes its surrounding <form> to be submitted; a plain button doesn't.
Oh, and a <button> can also be a "reset" button if you want.
So basically:

<button> is like <input type="submit">;
<button type="button"> is just a simple button that either triggers an event handler or does nothing;
<button type="reset"> is like <input type="reset">

(other than the content differences between <button> and <input> of course)
In some old versions of IE I think the default type was "button", so if you want to make sure things work it's a good idea to specify explicitly the sort of button you want in all cases.

