From 2b54ed0effdce90ab8b316752562af017fbfcca2 Mon Sep 17 00:00:00 2001 From: Ayo Date: Sun, 8 Oct 2023 04:26:43 +0200 Subject: [PATCH] feat: use setAttribute --- src/components/hello-world.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/hello-world.js b/src/components/hello-world.js index 54ac7f0..23b7556 100644 --- a/src/components/hello-world.js +++ b/src/components/hello-world.js @@ -9,8 +9,7 @@ export default class HelloWorld extends WebComponent { let count = 0; this.onclick = () => { console.log("Clicked!"); - this.name = `I was clicked ${++count} times`; - this.render(); + this.setAttribute("name", `I was clicked ${++count} times`); }; this.setAttribute("title", "Click me please"); }