logoalt Hacker News

Please, Use a Link

20 pointsby firefoxdyesterday at 9:53 PM1 commentview on HN

Comments

pannyyesterday at 10:01 PM

HTML5 made me sad when it took away,

<a href="/home"> <button>Home</button> </a>

That's validating under HTML4 strict. There was a valid way to use buttons without a form element or javascript, but now there is not. It was also neat from the standpoint that anchor doesn't allow nested block content (like a div), but button does. And since anchor doesn't require an href, you could use the same thing inside a form and let the button do the submit. That way you could uniformly style all your buttons/anchors on your entire site, whether they were really links or butttons.

show 1 reply