Tutorial by Examples

Defines an <initially-hidden> custom element which hides its contents until a specified number of seconds have elapsed. const InitiallyHiddenElement = document.registerElement('initially-hidden', class extends HTMLElement { createdCallback() { this.revealTimeoutId = null; } at...
It's possible to extent native elements, but their descendants don't get to have their own tag names. Instead, the is attribute is used to specify which subclass an element is supposed to use. For example, here's an extension of the <img> element which logs a message to the console when it's l...

Page 1 of 1