<button type="submit" class="button-danger" onclick="if(!window.confirm('aaa'))event.preventDefault();">aaa</button>
This is my original code. PHPStorm is showing that event
global variable is deprecated.
I do not want to make a separate function to do what I want but I just want this inline version built into the "onclick" attribute of the button.
Alternative that uses JQuery correctly will be better. Any advice will be appreciated.
EDIT: the linked question has answers that make a separate function. I want an INLINE version that is built into the onclick. I don't want to make my code long.