Re: The href attribute

The FAQ doesn't go into this detail but the href attribute is not just a 
hook for mouse interaction. It's the href attribute that makes the 
anchor element focusable and actionable with a keyboard and therefore 
with voice interaction.

To add the ability to put an href on any attribute would mean 
implementing this focusability and interaction for every/any element, 
plus the browser styling for focus indication. I imagine that is a lot 
of work for implementors.



On 28/01/2021 19:16, Bruce Lawson wrote:
> This is addressed at 
> https://github.com/whatwg/html/blob/main/FAQ.md#html-should-support-href-on-any-element 
> <https://github.com/whatwg/html/blob/main/FAQ.md#html-should-support-href-on-any-element> 
> 
> 
> Bruce
> 
> On Thu, 28 Jan 2021 at 15:04, Lea Verou <lea@verou.me 
> <mailto:lea@verou.me>> wrote:
> 
>     If memory serves, "href as a global attribute" was actually part of
>     the now defunct XHTML 2. There was no implementer interest, due to
>     backwards compat issues.
> 
>     Lea Verou✿ http://lea.verou.me <http://lea.verou.me> ✿Twitter &
>     elsewhere:@leaverou
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>>     On 2Dec, 2020, at 17:53, Tom de Visser <tom_devisser@icloud.com
>>     <mailto:tom_devisser@icloud.com>> wrote:
>>
>>     Hey there,
>>
>>     Just a quick idea that I think will really improve HTML markup. I
>>     haven’t found any caveats myself, but I don’t know if it’s
>>     possible. I’m not a super experienced developer, but I thought I’d
>>     give this a shot.
>>
>>     You often use anchor tags to wrap list items or images and you end
>>     up with a lot of messy markup tags, like <ul><li><a>Home …
>>
>>     Is it possible to add href to more elements? So you’d get things
>>     like <li href=“”> or <img href=“”>?
>>
>>     Thanks for considering!
>>     Tom
>>
> 
> 
> 
> -- 
> Bruce Lawson
> www.brucelawson.co.uk <http://www.brucelawson.co.uk>
> www.twitter.com/brucel <http://www.twitter.com/brucel>

-- 
Director @TetraLogical
https://tetralogical.com/

Received on Friday, 29 January 2021 04:58:48 UTC