I am getting a warning for my below code saying that 'event' in javascript have been deprecated.
HTML
<form onsubmit="handleFormSubmit(event)">
...
</form>
JS
function handleFormSubmit(event){
event.preventDefault();
}
I tried removing the 'event' from the attribute value. But this gives an error saying "event not defined".
HTML
<form onsubmit="handleFormSubmit()">
...
</form>
JS
function handleFormSubmit(event){
event.preventDefault();
}
I also tried the addEventListener() method and it does work as expected. But I am looking for a way to assign the function using inline attribute.