I have an issue while using buttons inside form. I want that button to call function. It does, but with unwanted result that it refresh the page.
My simple code goes
The problem is that it triggers the form submission. If you make the getData function return false then it should stop the form from submitting.
getData
return false
Alternatively, you could also use the preventDefault method of the event object:
function getData(e) { e.preventDefault(); }