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?
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?
Function of both tag is same in the form with type attribute.
<input type="submit" value="Post" />
<button type="submit">Post</button>