HTML6 icon indicating copy to clipboard operation
HTML6 copied to clipboard

use role="a", role="text" to display a link, input:text

Open reyhappen opened this issue 10 years ago • 2 comments

we should use role attribute to display a custom tag like an anchor or like text input

reyhappen avatar Mar 11 '15 08:03 reyhappen

<customtag role="a" href="#">this is an anchor</customtag> <customtag role="input" value="123" /> <customtag role="submit" value="post" />

reyhappen avatar Mar 11 '15 08:03 reyhappen

I don't see the point of doing so. You can just style them and use JavaScript to make them behave in the right way. However it would be cool to be able to extend the default elements... The good news is that they're already working on it. See HTML5Rocks!

Example of registerElement:

<script>
 document.registerElement("custom-anchor",{
   extends: HTMLAnchorElement,
   prototype: HTMLAnchorElement.prototype
 }
</script>
<custom-anchor href=#>I am an anchor!</custom-anchor>

I haven't tested it so don't know if it actually works. It's an early draft and afaik supported only in Chrome.

cshaa avatar Mar 11 '15 11:03 cshaa