- Should I use button or input?
- Should I use input or button for submit?
- What is the difference between input type button and input type submit?
- Do I need to use form with input?
Should I use button or input?
The difference is that <button> can have content, whereas <input> cannot (it is a null element). While the button-text of an <input> can be specified, you cannot add markup to the text or insert a picture.
Should I use input or button for submit?
input suggests that the control is editable, or can be edited by the user; button is far more explicit in terms of the purpose it serves. Easier to style in CSS; as mentioned above, FIrefox and IE have quirks in which input[type="submit"] do not display correctly in some cases.
What is the difference between input type button and input type submit?
<input type="button" /> buttons will not submit a form - they don't do anything by default. They're generally used in conjunction with JavaScript as part of an AJAX application. <input type="submit"> buttons will submit the form they are in when the user clicks on them, unless you specify otherwise with JavaScript.
Do I need to use form with input?
Yes, you can have a valid input without a form.