I am basing my question and example on Jason\'s answer in this question
I am trying to avoid using an eventListener
, and just to call handleClick
You can either use javascript url form with
Or use onSubmit event handler
In the later form, if you return false from the handleClick it will prevent the normal submision procedure. Return true if you want the browser to follow normal submision procedure.
Your onSubmit event handler in the button also fails because of the Javascript:
part
EDIT: I just tried this code and it works: