coryhouse / coryhouse/html5-web-components

document.registerElement() deprecated

Open
#9 4 comments 0 reactions 0 assignees View on GitHub
outdated
Dominant language
No language data
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

See here: https://developer.mozilla.org/en-US/docs/Web/API/Document/registerElement (says it's depreciated but scroll down to the 'Browser compatibility' section to see that no browser currently supports it).

Use customElements.define() method instead. Unfortunately the syntax is quite different:





class MyElement extends HTMLElement{
connectedCallback(){
this.innerHTML = "<h2>Pluralsight Comment</h2><textarea></textarea></br><input type='submit'>";
}
}
customElements.define('pluralsight-comment', MyElement);



This site helped me: https://css-tricks.com/an-introduction-to-web-components/

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.