]> git.scottworley.com Git - vopamoi/blob - vopamoi.ts
No MVMVC; DOM *is* the model.
[vopamoi] / vopamoi.ts
1 function createTask(description: string) {
2 const task = document.createElement("div");
3 task.appendChild(document.createTextNode(description));
4 task.setAttribute("tabindex", "0");
5 return task;
6 }
7
8 function addTask(description: string) {
9 document.body.appendChild(createTask(description));
10 }
11
12 function browserCreateTask(form: any) {
13 addTask(form.taskName.value);
14 form.taskName.value = "";
15 return false;
16 }