This is a very rudimentary question, but I'm sure someone out there knows why. In HTML, when I make a button element on its own, and donβt give it, and onclick
and without jQuery .click()
, the button just does nothing. Excellent. But when I do this, but the button is inside the <form>
element, it tries to send the GET data of all form elements to the root address of my site? Why is this so? I did not make it a submit button or even defined a method
or action
in this form
Thanks for the info in advance!
** EDIT **
This is what I did to solve the problem. For buttons inside <form>
use:
<button type="button"></button>
And by default it will not do anything.
source share