]> git.scottworley.com Git - vopamoi/commitdiff
Put tasks in a div
authorScott Worley <scottworley@scottworley.com>
Wed, 26 Jan 2022 20:50:10 +0000 (12:50 -0800)
committerScott Worley <scottworley@scottworley.com>
Thu, 27 Jan 2022 20:21:55 +0000 (12:21 -0800)
index.html
vopamoi.ts

index 2a82c981a64eb33f712fecb9bcfdd50c82981dbf..91908e3980510185f608b7827f945dabe4fbb855 100644 (file)
@@ -7,5 +7,6 @@
     <form onsubmit="return BrowserUI.addTask(this);">
       <input id="taskName" name="taskName">
     </form>
+    <div id="tasks"></div>
   </body>
 </html>
index ad1051ad5f9ffc6a4712dc1acada82944e643fac..725f3a0209c2b41a51d8b18afe2834fa545b6a72 100644 (file)
@@ -15,7 +15,7 @@ function splitN(str: string, delimiter: string, limit: number = MAX_SAFE_INTEGER
 
 const Model = {
   addTask: function (timestamp: string, description: string) {
-    document.body.appendChild(this.createTask(timestamp, description)).focus();
+    document.getElementById("tasks")!.appendChild(this.createTask(timestamp, description)).focus();
   },
 
   createTask: function (timestamp: string, description: string) {