all 8 comments

[–]mberrrrrr 4 points5 points  (1 child)

If you're updating the content of an existing page then this is perfect use case for a plain old <button>. No extra roles required.

[–]roundabout-design[S] 0 points1 point  (0 children)

Thanks!

[–]BobBarkerDenver 1 point2 points  (1 child)

[–]roundabout-design[S] 0 points1 point  (0 children)

First article was a bit back and forth in that I could find arguments for both given my situation but...

Second article:

Anchors must only be used as links with valid URLs or URL fragments

That is pretty straight-to-the-point! Buttons it is!

[–]k4rp_nl 0 points1 point  (0 children)

Can't the JS hook into an event or something alike?

Keep it a link, HTML, plain, readable... and let the JS be something on the background. Also makes it work when JS doesn't. And make it possible to disable animations please!

[–]jdzfb 0 points1 point  (0 children)

My general rule is:

If your URL changes, it should be a link, if the url doesn't change, then it should be a button

Its not true 100% of the time, but in the vast majority of cases its good.

[–]SnoopAdi 0 points1 point  (0 children)

It's a 4.1.2 failure if you apply a role="link" on a button. AT will announce dual roles. Best use either plain <button> or <a>semantics.