I quickly tested t开发者_开发百科his in Firefox, and it seems to work
<a href="somewhere"><button>Go</button></a>
The Validator didn't choke on it, but is it a reliable way to make a button a link?
Well, anchors are not necessarily links. This is why the validator doesn't choke. External anchors contain an HREF, sure, but internal anchors simply have a name attribute that can be referenced by placing #name in the URL.
Now, whether or not you should be placing a button in a link is another issue. The DOM uses event bubbling, so technically the button should respond to the click before the link does. But I do not know if this translates the same across all browsers.
精彩评论