32 Answers
New Answer32 Answers
New AnswerYou can use html in <button></button> With <input type="button"> you can only use string as value value="string". You can use spans inside <button>. But according to W3C divs inside a button is incorrect in HTML5 <button> <span style="color: red">Hello</span> <span style="color: black">World</span> </button> Input tags are "meant" to be used inside a form and <button> outside on random click events. And of course <input type="button"> has all <input> tags attributes.
When you wanna make a button to within form then you have code <input type ="button"> (Here button is a value) as well as if you wanna just a make button you can use <button></button> Tag.
https://stackoverflow.com/questions/469059/button-vs-input-type-button-which-to-use
Raj Chhatrala i search in this website before asking, but i didn't understand well.. thanks for answer bro π
nic3..question but i think the answers were not precise......well we all know.......one is value and other is tag but......π
Mohammad Ismail yeah i know that.. but when should i use button tag and when button value?!
If you wants to makes a form use button value (submit button,send button) and when you wants make just button use Tag. Basically these two are same.
for one the <button></button> is for basically jumping around in a website whereas <input type="button"> is a radio button better for forms and widgets.
no in input tag we can use text, password, number, button,etc..ππ MD. Tanjed Hasan Riyad
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message