]> git.scottworley.com Git - vopamoi/commitdiff
Use classList to set class
authorScott Worley <scottworley@scottworley.com>
Thu, 27 Jan 2022 19:12:40 +0000 (11:12 -0800)
committerScott Worley <scottworley@scottworley.com>
Thu, 27 Jan 2022 20:22:17 +0000 (12:22 -0800)
vopamoi.ts

index a76db5b982b99a1c3ccfd38f82fcd3815b845efa..c079bd465ec3dd8dd3e52843b3d1d2749ec046dc 100644 (file)
@@ -33,7 +33,7 @@ const Model = {
   addTask: function (timestamp: string, description: string): Element {
     const task = document.createElement("div");
     task.appendChild(document.createTextNode(description));
   addTask: function (timestamp: string, description: string): Element {
     const task = document.createElement("div");
     task.appendChild(document.createTextNode(description));
-    task.setAttribute("class", "task");
+    task.classList.add("task");
     task.setAttribute("tabindex", "0");
     task.setAttribute("data-created", timestamp);
     task.setAttribute("data-state", "todo");
     task.setAttribute("tabindex", "0");
     task.setAttribute("data-created", timestamp);
     task.setAttribute("data-state", "todo");