Skip to main content

To-Do list Project

 To-do list Project in Javascript

Program to create a to-do list project in HTML, CSS and Javascript.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>To Do List</title>
</head>
<body>
  <div style="margin-left: 20%; margin-right: 20%; margin-top: 5%">
    <h1 align="center" style="color: Green; font-family: Lucida Console"> My Task List</h1>
    <br>

    <div class="row" align="center" style="border: 2px solid green ; 
border-radius: 20px; 
height: 15%; 
width: 60%;
margin-top: 20px;
margin-left:20% ;
margin-bottom: 3%; ">

      <form>
        <div class="input-group">
          <input type="text" id="box" style="width:20vw;  height: 2vw; margin-top: 20px; border: none; border-bottom: 2px solid green" placeholder="Add Task">
          <br><br>
          <div class ="form-group" style="width:20vw; margin-bottom: 50px" >
            <input type="button" value="Add" style="width:5vw; height:3vw ; background-color : MediumSeaGreen ;float: right; border: none;border-radius: 8px; color: white" onclick="add_item()">
          </div>
<ul id ="list_item" style="color: grey">
      </ul>
        </div>
     
      </form>
      

    
</div>
     </div>
  <script type="text/javascript">
      function add_item()
      {
         let item = document.getElementById("box");
         let list_item = document.getElementById("list_item");

         if (item.value != "")
         {
            let make_li = document.createElement("li");
            make_li.appendChild(document.createTextNode(item.value));
            list_item.appendChild(make_li);

            item.value = "";

            make_li.onclick = function(){ this.parentNode.removeChild(this); }
         }
         else
         { alert("Please add the task !")}
      }

  </script>
</body>
</html>







Comments

Popular posts from this blog

Python Turtle : Create a attractive Petal Design

 Python Turtle Attractive Petal design in Python  import turtle # create the turtle object trt = turtle.Turtle() # create the screen object scr = turtle.Screen() #increase the pensize trt.pensize( 3 ) # set the background color to black scr.bgcolor( 'black' ) # set the pencolor to white colors = [ 'red' , 'orange' , 'yellow' , 'skyblue' , 'blue' , 'indigo' , 'violet' ] # increase the speed trt.speed( 0 ) # now first create a single petal # lets define the distance dis = 50 trt.color( "yellow" ) for color in range ( 20 ): for j in range ( 1 , 8 ): trt.left( 50 ) for i in range ( 2 ): trt.forward(dis) trt.left( 60 ) #rotate at 60 degree in clockwise trt.forward(dis) trt.left( 120 ) #rotate at 120 degree in clockwise dis = dis + 5 #hide the turtle after the shape has been drawn trt.hideturtle() turtle.done() Output : Learn thr...

Python Turtle tutorials : Create a Bi-Pyramid structure

 Python Turtle Tutorials  Create a Bi-Pyramid structure using Python  Code :           """ Program to create a Bi-pyramid structure Source : CODE PROBLEM (Youtube) """ import turtle scr = turtle.Screen() # create screen object scr.bgcolor( 'black' ) turtle.speed( 0 ) # the fastest speed turtle.pensize( 2 ) # set the width of the drawing pen turtle.color( 'skyblue' ) # set pencolor to 'skyblue' for i in range ( 30 ): turtle.fd(i* 10 ) turtle.right( 120 ) for j in range ( 29 , 0 ,- 1 ): turtle.fd(j* 10 ) # move forward turtle.left( 120 ) turtle.hideturtle() # hiding the turtle after the completion of the drawing turtle.done() # for holding the screen Output : Learn from video : Watch on youtube

Graphics in Python using Turtle framework

  Python turtle Tutorial : Create an amazing Tiranga badge   Tiranga badge using Python Turtle. # first import the turtle module import turtle # create the turtle object trt = turtle.Turtle() #create the screen object scr = turtle.Screen() scr.setup( 850 , 850 ) # set the background color of the window (canvas) to balck scr.bgcolor( 'black' ) # increase the speed of the turtle trt.speed( 0 ) # increase the width of the turtle trt.pensize( 5 ) # now define list of colors required colors = [ 'orange' , 'white' , 'green' ] # now get into the central part of the logic radius = 150 # initially the radius is 150px # first define a for loop for every color for color in colors: # define a for loop for number of required iteration .. here we need 5 for i in range ( 6 ): # now define the loop for drawing the circles and changing the size for j in range ( 6 ): trt.color(color) trt.circle(radius) #define the variable...