Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between button and input? [duplicate]

Are there any major differences between <button type="button" name="theButton">SUBMIT</button> and <input type="submit" value="SUBMIT" name="theButton" />

Also, can you use <button type="submit" name="theButton">SUBMIT</button>?

like image 612
DarkLightA Avatar asked Dec 20 '10 09:12

DarkLightA


People also ask

What is the difference between input and button?

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.

What is the difference between button and input type submit?

A 'button' is just that, a button, to which you can add additional functionality using Javascript. A 'submit' input type has the default functionality of submitting the form it's placed in (though, of course, you can still add additional functionality using Javascript).

What is difference between button and submit in HTML?

Submit button is added for a form. When submit is clicked it triggers to the address written in the "action" attribute of form element. Button can be used anywhere as a general purpose. It can be used to redirect to any link and not restricted to a form action.

What can I use instead of a button in HTML?

You use css and style a link <a> to look like a button.


1 Answers

Here's a page describing the differences (basically you can put html into a <button></button>

And an other page describing why people avoid <button></button> (Hint: IE6)

Reference: <button> vs. <input type="button" />. Which to use?

Also have a look at this slideshow about button.

like image 58
Zain Shaikh Avatar answered Sep 17 '22 15:09

Zain Shaikh