I dunno. Why would you even try to use onclick instead of onsubmit. You’ll need to capture return keys, handle accessibility etc etc etc. It’s simply not the right thing to do.
Also. Onclick will simply execute the content as JavaScript. So if you’re not passing an argument, why would you expect an argument?
You can simply return false to prevent the defaults from happening.
The whole article has nothing to do with a rabbit hole. But more with a junior dev