Last active
June 9, 2020 08:53
-
-
Save BenOsodrac/2c124b4b536975ed4abf578546524d3d to your computer and use it in GitHub Desktop.
This file contains 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
class Card extends HTMLElement { | |
// A getter/setter for a disabled property. | |
get disabled() { | |
return this.hasAttribute('disabled'); | |
} | |
constructor() { | |
// Always call super() first! This is specific to Custom Element and required by the spec. | |
super(); | |
this.addEventListener('click', e => { … }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment