I hate to be critical, and maybe I'm missing something, but this essay didn't read well at all. Sounded like somebody who didn't fully understand what they were doing thrashing around.<p>We use anchor tags as buttons any more because clicking on buttons should (eventually) change the href.location. That means, yes, right-click should work just fine, opening up a new window with your action applied to the current state. Don't look at buttons like Javascript events. Rather look at them like code that changes the URI that then kicks off Javascript events. It's a subtle difference, but it's very important. An anchor as a button isn't the same as a button because they're two completely different things. Your mental model of each should be different.<p>I don't see where there's much of a mystery or rant here, but maybe I missed it.
Actual buttons annoy me. I like navigating around using just the keyboard, so a lot of the time I just do a search for the link I want to click (ctrl-f on Chrome or ' on Firefox) then just use enter to click the link. This works great when the button is actually just a styled link, but does not work at all with an actual button.<p>Of course, I'm indubitably in a tiny minority, but it's still something to note.
Why don't you add href='#' and return false from the click event. Nothing gets added to the history that way.<p>Better yet, add a href='/uri/to/script' as a fallback in case the user has JS disabled.
For a moment there I was trying really hard to understand what he was complaining about. His post made very little sense to me as it was written. I guess because I haven't even come close to experiencing his "problem".<p>Especially since I looked over the pull request he mentions and the explanation as to why href="#" is used is right there in front of his face.<p>Plus, what's with all the hate for href="#"? Are some people so anal about their code they can't leave one simple little thing in place that makes life easier for them?
You missed not being able to disable them without javascript if you set the href, pretty big disadvantage to miss. I vaguely remember IE might support the disabled attribute, but it doesn't actually work properly. That might just be 6 though. I also have a feeling there are other weird side effects to not setting a href attribute on an anchor, but maybe it's just that.<p>This doesn't feel a very comprehensive or well researched post, especially as you didn't know about e.preventDefault() which afaik is standard practice these days, seems a fairly ballsy thing to ask bootstrap to do when you don't really seem to know much about it.<p>Then again I guess if you don't question these things, you never find out!
here's what i do, i use button tag where it has to look like a button and use a link where it has to look like a link. Also if link requires an eventhandler instead of href change i simply omit href attribute altogether and write my css to apply to a tag irrespective of weather it has href attribute or not. problem solved.
You create an anchor like you would, you write a proper onClick handler that does your favorite animation and then sets the window.location to the href or if you don't want to figure this out, you could just use something like jQuery UI button and you are happy.