Skip to content

Instantly share code, notes, and snippets.

Created February 28, 2020 13:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A simple Todo Application
<!doctype html>
<title>Sample To-Do</title>
<style type="text/css">
section {margin: 0 auto;width: 100%;}
h3, h5, li {float: left;width:100%;}
ul {list-style: none;}
input[type=checkbox], p { float:left;margin: 0;}
<h3> To-Do Application</h3>
<h5> Add your todo below</h5>
<textarea id="newtodo" placeholder="Enter your todo here..."></textarea>
<button id="newtodosub" onclick="addtodo();">Add</button>
<ul id="todos"></ul>
<script type="text/javascript">
function addtodo() {
'<li id="todoitem"><input type="checkbox" onclick="function rem(el) {'
+ '\'float:left;text-decoration:line-through\';el.setAttribute(\'disabled\', \'disabled\')};rem(this);" />'
+ '<p style="float:left;">&nbsp;&nbsp;&nbsp;' + document.getElementById("newtodo").value + '</p>'
+ '</li>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment