I have a header element which needs to fire off some JavaScript when clicked. I know I should only use <a>
tags when the page is actually changing, and that <button>
s are preferred for JS functions, but for some reason it just feels wrong to do
<h2><button onclick="myFunction();">My Title</button></h2>
I can't put my finger on why that doesn't feel semantically correct. Is it just me?