1 min readJun 25, 2020
See, you use separation of concerns as a reason -- and it's a good reason at that -- but you don't take it far enough.
Since if that button tag only works when scripting is enabled, it has ZERO business in the HTML in the first place. Instead you should have a noscript tag telling users why your page doesn't work for them.
Hence when you said it works great for dynamically added elements? Well such a button should be a dynamically added element.
Also should probably be set to type="button" unless you really want it to work as a submit.