javascript to do list

How we can create a to do list using HTML CSS JavaScript? Solution: See this JavaScript To Do List With CSS, List With Check and Delete Options.

Previously I have shared lots of JavaScript Programs, this to-do list is also a part of that pure JS category. Basically, the to-do list is for remember and check what you have to do today. And mostly this type of list people save in mobile apps, computers, notebook, etc but you also can create to do list using JavaScript programming.

Today you will learn to create To-Do list with checked and delete options. Basically there is text input filed and button with add icon, when you will type anything in the field and click on add button that task will be added and appears in the bottom. After adding multiple tasks, you have checked task which you have done and also you can delete them.

So, Today I am sharing JavaScript To Do List With CSS. This program is built-in pure JavaScript, there is no library or framework. And this program is a perfect example of how JavaScript can add or delete HTML CSS elements dynamically. If you are a beginner, then this program will best practice for you.

If you are thinking now how this list program actually is, then see the preview given below.

Preview Of Tasks List With Checked and Delete Options

See this video preview to getting an idea of how this task list program looks like.

Live Demo

Now you can see this visually, you can also see it live by pressing the button given above. If you like this, then get the source code of its.

You May Also Like:

JavaScript To Do List With CSS Source Code

Before sharing source code, let’s talk about it. First I have create a text input filed using HTML <input type="text">  tag and a button with icon for adding tasks. After that, created a div and placed HTML list tag <ul> with an ID name and JS will add items inside it. There are some icons like plus, trash, for placing these icons I have used Font-Awesome library (get).

Now using CSS I have placed all the elements on the right place, as you can see in the preview. & inside the button put the icon class, and styled other elements. There is also a CSS effect for a checked or completed task, you can see a line middle of the text. For creating this effect used CSS text-decoration: line-through; command.

JavaScript detects all the actions and changing CSS values and adding HTML elements. When you will add any task that will adds on the list below, for that I have used JavaScript’s document.createElement function to store task’s data. Left all other things you will understand after getting the codes, I can’t explain all in writing.

For creating this program you have to create 3 files for that. First file for HTML, second for CSS and the third for JavaScript. Follow the steps to creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

function.js

The final step, Create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created JavaScript To Do List With CSSList With Checked and Delete Options. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

2 COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here