javascript - Custom HTML Tag -
i have 2 questions concerning custom html tags.
when created custom html tag , tried custom html file (code below) in different browsers. wondering if can test in older versions of safari , see compatibility custom html tags.
and need javascript stuff mentioned in these article?
https://www.html5rocks.com/en/tutorials/webcomponents/customelements/
https://developers.google.com/web/fundamentals/architecture/building-components/customelements
<style> custom-tag { background-color: red; padding: 100px; } </style> <custom-tag>this custom tag.</custom-tag> <script> alert(document.getelementsbytagname('custom-tag')[0].tagname) </script>
the results of code in internet explorer...
ie6 = js works not css
ie7 = js works not css
ie8 = js works not css
ie9 = js works not css
ie10+ = works
according caniuse, custom elements supported in:
- chrome 33 , onwards
- opera 20 , onwards
- android 4.4.4 , onwards
- firefox 23 , onwards (with
dom.webcomponents.enabled
preference inabout:config
)
and not supported in:
- any version of ie (although own tests confirm is supported in ie 11)
- any version of edge (although own tests confirm is supported in edge 20)
- any version of safari
this in relation working draft (last updated 13 october 2016). it's quite possible caniuse has not been updated cover latest revision of draft.
hope helps!
Comments
Post a Comment