Skip to content

Instantly share code, notes, and snippets.

@LeoSaucedo
Last active August 8, 2019 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LeoSaucedo/de8b57872be6ad0f6107257dc9f38284 to your computer and use it in GitHub Desktop.
Save LeoSaucedo/de8b57872be6ad0f6107257dc9f38284 to your computer and use it in GitHub Desktop.
todo-mini initial EJS.
<html>
<head>
<title>ToDo App</title>
<link
href="https://fonts.googleapis.com/css?family=Lato:100"
rel="stylesheet"
/>
<link href="/styles.css" rel="stylesheet" />
</head>
<body>
<div class="container">
<h2>To-Dos</h2>
<form action="/addtask" method="POST">
<input
class="textbox"
type="text"
name="newtask"
placeholder="add new task"
/>
<button>Add Task</button>
<h2>Incomplete</h2>
<ul>
<% for( var i = 0; i < task.length; i++){ %>
<li>
<input type="checkbox" name="check" value="<%= task[i].task %>" />
<%= task[i].task %>
</li>
<% } %>
</ul>
<button formaction="/removetask" type="submit" id="top">
Complete
</button>
<h2>Completed</h2>
<button formaction="/clearcomplete" type="submit" id="bottom">
Clear all tasks
</button>
</form>
<ul>
<% for(var i = 0; i < complete.length; i++){ %>
<li>
<input type="checkbox" checked disabled /><%= complete[i].task %>
</li>
<% } %>
</ul>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment