From 44cf2661f05995908931bc8b996e28e2f4674928 Mon Sep 17 00:00:00 2001
From: Ayo
-class HelloWorld extends HTMLElement {
- static observedAttributes = ["name"];
-
- connectedCallback() {
- let count = 0;
- this.onclick = () => {
- this.setAttribute("name", `Clicked ${++count}x`);
- };
- this.setAttribute("title", "Click me please");
- }
-
- attributeChangedCallback(property, previousValue, currentValue) {
- if (previousValue !== currentValue) {
- this.innerHTML = ``;
- }
- }
-}
- Start at the very basic of writing HTML files and enhance with standard web technologies or go advanced as you like, at your own pace.