Open reyhappen opened 9 years ago
<customtag role="a" href="#">this is an anchor</customtag> <customtag role="input" value="123" /> <customtag role="submit" value="post" />
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.
we should use role attribute to display a custom tag like an anchor or like text input