[whatwg] Proposal for a link attribute to replace <a href>

Shannon schrieb:
> With the capabilities of modern browsers it seems to me that a specific 
> tag for hyperlinks is no longer required or useful and could be 
> depreciated with a more versatile global "link" attribute. I believe 
> that hyperlinks now have more in common with attributes such as ONCLICK 
> than they do with tags since in web applications links often define 
> actions rather than simply being a part of the document structure. The 
> <A> tag would continue its role as an anchor but the HREF attribute 
> would be phased out making <A> a more consistent element (since links 
> and anchors are really quite separate concepts). Below is an example of 
> the proposed link attribute in action:
> 
> <li><a href="foo.html">Foo</a></li>
> 
> could be written as:
> 
> <li link="foo.html">Foo</li>
> 
> No useful semantic information is lost however the markup is cleaner and 
> the DOM drops an unnecessary node (which could speed up certain 
> applications).

I like this idea - this could significantly reduce the amount of 
scripting in web pages and applications, and thus increase the 
accessibility of hyperlinks.

Anyway, why do you suggest a new attribute rather than making the 
existing href attribute global?

<li href="foo.html">Foo</li>

That makes your idea backwards compatible - provided UAs interpret 
attributes of unknown tags, they will even be capable to correctly 
handle occurrences of <a href> when the A element will be totally 
removed from their code.

-- 
Markus Ernst

Received on Wednesday, 27 February 2008 05:43:10 UTC