[whatwg] href attribute

Colin Lieberman colin at fontshop.com
Fri Mar 2 09:25:45 PST 2007

Alexey, I see your point regarding buttons, but there are many other 
cases where an a element seems unnecessary and redundant (as others have 
pointed out):

<ul id="main_nav">
<li href="/">Home</li>
<li href="/about/">About</li>

clickable images (like a thumbnails gallery)

glossary links: <abbr title="hypertext markup language" 

There are, I think, numerous cases like these we encounter every day 
where an a is slipped inside another element because that's the only way 
to make the link, and the anchor itself serves no other purpose.

 From a semantics point of view, the clickablility of an object and the 
destination URI of that action is a property of the element itself, and 
it makes much more sense to me to use an attribute, rather than a 
separate element, for these sorts of cases.

Colin Lieberman

Alexey Feldgendler wrote:
> On Fri, 02 Mar 2007 17:55:34 +0100, Colin Lieberman <colin at fontshop.com> wrote:
>> One of the strengths of the current XHTML2 spec is the broadened use of
>> the href attribute
>> (http://www.w3.org/TR/xhtml2/mod-hyperAttributes.html#adef_hyperAttributes_href)
>> -- and the resulting requirement for user agents that any element with a
>> (valid) href element be an actionable link.
> Any element can be made into a button, but HTML has the <button> element to explicitly express the button semantics. I think you won't argue that
> <button onclick="...">Calculate</button>
> ...is preferable than
> <span class="button" onclick="...">Calculate</span>
> Likewise, HTML has <a> to explicitly express the semantics of a hyperlink. I don't see how the language would benefit from the ability of turning any element into a link.

More information about the whatwg mailing list