How to Create ToDo App using HTML, CSS, JS and Bootstrap ?
We will create a basic todo app to understand the basics of JavaScript. In this web app, one can create a todo list and can remove specific elements from the list.
Features or Functionalities to implement:
- Interactive and Responsive design
- Responsive Grid System
- Store and Delete items
Prerequisites: Basic knowledge of HTML, CSS, JavaScript, jQuery, and Bootstrap. Also, the user should be aware of how the grid system in Bootstrap works.
Setup: Create three files for HTML, CSS and JavaScript. To create these files run the following command:
- Syntax:
$ touch index.html index.css index.js

- Step 1: Now edit index.html file.
<!DOCTYPE html><htmllang="en"dir="ltr"><head><metacharset="utf-8"><title>todo</title><linkrel="stylesheet"href="style.css"><!-- Latest compiled and minified CSS --><linkrel="stylesheet"href=</head><body><divclass="container"><h1class="row">TODO APP</h1><br/><br/><divclass="row"><formclass="form-inline col-sm-offset-3"><divclass="input-group"><spanclass="input-group-addon"><iclass="glyphicon glyphicon-pencil"></i></span><inputtype="text"class="form-control"placeholder="todo-item"id="box"style="width: 30vw"/></div><divclass="form-group"><inputtype="button"class="btn btn-primary form-control"value="add"style="width: 10vw"onclick="add_item()"/></div></form></div><divclass="row"><ulid="list_item"></ul></div></div><scripttype="text/javascript"src="main.js"></script></body></html>chevron_rightfilter_none - Step 2: Now, add some CSS property to index.css file.
* {padding:0;margin:0;box-sizing: border-box;font-family:cursive;}body {background:#f2f2f2;overflow:auto;}h1{text-align:center;margin:5%;font-size:3rem;text-decoration:underline;}ul {text-align: lleft;padding-left:10%;padding:7%;font-size:2rem;list-style:circle;}li:hover{color:red;margin:4%;transition:1.5s ease;cursor:pointer;}chevron_rightfilter_none - Step 3: Edit index.js file and add some functionality.
// Function called while clicking add buttonfunctionadd_item() {// Getting box and ul by selecting id;let item = document.getElementById("box");let list_item = document.getElementById("list_item");if(item.value !=""){// Creating element and adding value to itlet make_li = document.createElement("LI");make_li.appendChild(document.createTextNode(item.value));// Adding li to ullist_item.appendChild(make_li);// Reset the value of boxitem.value=""// Delete a li item on clickmake_li.onclick =function(){this.parentNode.removeChild(this);}}else{// Alert msg when value of box is "" empty.alert("plz add a value to item");}}chevron_rightfilter_none - Output:

Recommended Posts:
- How to Create ToDo App using ReactJS ?
- How to Create Todo List in Angular 7 ?
- How to create responsive image gallery using HTML, CSS, jQuery and Bootstrap?
- How to create five equal columns in Bootstrap ?
- How to create Responsive Bottom Navigation Bar using Bootstrap ?
- How to use SASS to create new set of color styles in Bootstrap 4 ?
- How to Create a Bootstrap Spinner and Display on Screen till the data from the API loads ?
- How to create responsive website zoomed out to full width on mobile using Bootstrap?
- How to create a radio button similar to toggle button using Bootstrap ?
- How to use complex HTML with twitter Bootstrap tooltip using jQuery ?
- How to create a Pie Chart using HTML & CSS ?
- How to create three boxes in the same div using HTML and CSS ?
- Create a Search Bar using HTML and CSS
- How to Create Breadcrumbs using HTML and CSS ?
- How to Create Toggle Switch by using HTML and CSS ?
- How to create waves on button with CSS and HTML?
- How to create a Portfolio Gallery using HTML and CSS ?
- How to Create a Cutout Text using HTML and CSS ?
- Create a 3D Text Effect using HTML and CSS
- How to Create a Transparent button using HTML and CSS ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


