Created
July 3, 2017 16:01
-
-
Save sumbad/fa6427d7baedc73660198b5f6475405a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Custom Elements</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/document-register-element/1.5.0/document-register-element.js"></script> | |
<script type="text/javascript"> | |
class HelloInputCustomElement extends HTMLInputElement { | |
connectedCallback() { | |
this.setAttribute('value', 'Hello'); | |
} | |
} | |
window.customElements.define('helloinput-custom-element', HelloInputCustomElement, { | |
extends: 'input' | |
}); | |
</script> | |
</head> | |
<body> | |
<input is="helloinput-custom-element"></input> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment