'which is better using <input type = submit> or <button>? [duplicate]

I've been writing an HTML/PHP code that sends data using a Form. I found that I can use <button> with ajax to send the data, or use <input type= submit> to do the same task.

I want to know which is better or preferable to use and why?



Solution 1:[1]

Function of both tag is same in the form with type attribute.

<input type="submit" value="Post" />
<button type="submit">Post</button>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Suraj Paudel