Correct way to create button for html

Why is there a different approach to creating a button, and which one to use, when.

<form>
<input type="button">
<button type="button"></button>
</form>

      

I would like to get some explanation.

+3


source to share


1 answer


There are a few differences, but from your code the most relevant is

<input type="button">

since the input field is submitted when the form is submitted to the server for elab and you can eval serverside assign the value attribute to the input signal attribute



<button type="button"></button>

is only a local client tag

0


source







All Articles