-var tasks: string[] = [];
-
-function createViewTask(task: string) {
- const viewTask = document.createElement("div");
- viewTask.appendChild(document.createTextNode(task));
- return viewTask;
-}
-
-function updateView() {
- tasks.forEach((t) => document.getElementById(t) || document.body.appendChild(createViewTask(t)));
+function createTask(description: string) {
+ const task = document.createElement("div");
+ task.appendChild(document.createTextNode(description));
+ task.setAttribute("tabindex", "0");
+ return task;