From: Scott Worley Date: Thu, 27 Jan 2022 19:12:40 +0000 (-0800) Subject: Use classList to set class X-Git-Url: http://git.scottworley.com/vopamoi/commitdiff_plain/7ccc80f6ed4900117a4a9e481c8e82670e006b86?ds=inline Use classList to set class --- diff --git a/vopamoi.ts b/vopamoi.ts index a76db5b..c079bd4 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -33,7 +33,7 @@ const Model = { 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");