+ 4
difference between input submit and button
what is difference between <input type="submit" value="submit"> and <button type="submit>submit</button>
8 odpowiedzi
+ 7
I think no difference
+ 2
Ah, OK, I found the answer on Stack Overflow, if anyone's interested, maybe some people searching for this question in future :)
https://stackoverflow.com/questions/7117639/input-type-submit-vs-button-tag-are-they-interchangeable
Basically, some old version of IE (6/7) do not support <button>, but they are not that much in use anymore, and you can place alternative text if you think you will have users with those types of browsers.
Otherwise, seems like <button></button> is recommended as more readable, and also it has an opening and closing tag, so you can nest in it other HTML elements like images, etc... So you have more options to customize it.
+ 1
a button with a submit type will do it as well. Test it out.
+ 1
Hmmmm...... more than a year later, I am asking myself the same question (thank you, search function!) :D
In the SoloLearn HTML course they suggest <input type="submit"> and in FreeCodeCamp they suggest <button type="submit"></button>. I guess one of them could be legacy and the other a new version? Usually when there are two functions that seem to do exactly the same thing, there is always some slight difference, otherwise one would get deprecated.
Maybe there's browser compatibility issues with one of them?
I want to believe that it's just the same, but I am always suspicious that it's never exactly the same in how it works :D :D
0
submit use when you want to send form in server to prossess (when you use asp.net,php)
but button you can use it in javascript
0
@ASNM you can manipulate the submit input type with JavaScript too.
There's no big difference. In a form, a button with a submit type will behave similarly to an input type submit. A button without a submit type will do absolutely nothing. Both can be controlled by javascript
0
when use submit and connect form in php will page reload but in button not
0
i test it before 😊😊😊