Created
December 22, 2020 00:03
-
-
Save lgarron/8f5c968f28fcbfb85291f4bb52383a38 to your computer and use it in GitHub Desktop.
<domain-name>
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> | |
<script type="module"> | |
class DomainNameElement extends HTMLElement { | |
connectedCallback() { | |
this.textContent = (new URL(location.href)).hostname | |
} | |
} | |
customElements.define('domain-name', DomainNameElement); | |
</script> | |
<domain-name></domain-name> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment