Skip to content

Instantly share code, notes, and snippets.

@BenOsodrac
Last active June 9, 2020 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BenOsodrac/2c124b4b536975ed4abf578546524d3d to your computer and use it in GitHub Desktop.
Save BenOsodrac/2c124b4b536975ed4abf578546524d3d to your computer and use it in GitHub Desktop.
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