tudo app using html and css javascript

Hello friends, Welcome to your Techgsr.co blog. And today in this article we will Devloped tudo app using html and css javascript .So let’s go to our to.

Index.html

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>TODO APPLICATION</title>
    <link
      href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
      rel="stylesheet"
      integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6"
      crossorigin="anonymous"
    />
  </head>
  <body class="bg-primary">
    <!-- main html content -->

    <div class="container my-2">
      <h1 class="text-center text-white">TODO APPLICATION</h1>

      <div class="card">
        <div class="card-body">
          <form action="#">
            <input
              id="title"
              type="text"
              class="form-control"
              placeholder="Enter todo title"
            />

            <br />

            <textarea
              id="desc"
              cols="30"
              rows="10"
              class="form-control"
              placeholder="Enter todo description"
            ></textarea>

            <div class="container text-center mt-2">
              <button onclick="add_todo()" class="btn btn-primary">
                ADD TODO
              </button>
            </div>
          </form>
        </div>
      </div>

      <br />

      <div class="main-content" id="main-content"></div>
    </div>

    <script>
      const add_todo = () => {
        let title = document.getElementById("title").value;
        let desc = document.getElementById("desc").value;

        let todos = [];

        //string
        let localTodos = localStorage.getItem("todos");

        if (localTodos != null) {
          todos = JSON.parse(localTodos);
        }

        let todoObject = {
          title: title,
          desc: desc,
          id: Math.trunc(Math.random() * 1000),
        };

        todos.push(todoObject);

        localStorage.setItem("todos", JSON.stringify(todos));

        show_todo();

        //case:

        //
        // localStorage.setItem(todos, [{title,desc},{title,desc},{title,desc}]);

        //todos=>[]
      };

      //show the data

      const show_todo = () => {
        let todoString = localStorage.getItem("todos");

        let content = "";

        if (todoString == null) {
          //no todo
          content += "<h3 class='text-white'>NO TODO TO SHOW</h3>";
        } else {
          let todos = JSON.parse(todoString);
          for (let todo of todos.reverse()) {
            content += `
              
              
              <div class='card mt-2'>
                <div class='card-body'>
                       <h3>${todo.title}</h3>
                       <p>${todo.desc}</p> 
                </div>    
              </div>
              
              
              `;
          }
        }

        document.getElementById("main-content").innerHTML = content;
      };

      show_todo();
    </script>
  </body>
</html>

So I hope that you learn about the tudo app using html and css javascript   And if you have any more queries about progrmming ,web Devlopment ,tech,computer relegated then feel free to discuss your problem in the comment section.Thank you so much and come back for more updates about Techgsr.co .

Related post

  1.  tudo app using html and css javascript

  2. how to create age calculator in html project

  3. how to make toast in html css and javascript

  4. how to make copy to clipboard in javascript

  5. how to create email validation in javascript

 

 

Predict the output of following C++ program in cpp

 

 Hello friends, Welcome to your Techgsr.co blog. And today in this article we will learn about  Predict the output of following C++ program in cpp .So let’s go to our topic

#include<iostream>
using namespace std;
class Test
{
static int i;
int j;
};
int Test::i;
int main()
{
cout << sizeof(Test);
return 0;
}

Assume that integers take 4 bytes.

Output:
4 (size of integer)
static data members do not contribute in size of an object. So ‘i’ is not considered in size
of Test. Also, all functions (static and non-static both) do not contribute in size.

Related Post:-

Predict the output of following C++ program in cpp

Print 1 to 100 in C++, without loop and recursion

Factorial Using Loop Example Program In C++

bfs algorithm in data structure (BFS)

if..else Statement Example Program In C++

For Loop Example Program In C++

Program to find the sum of each row & column of a matrix of size n x m andif matrix is square, find the sum of the diagonals also.

 tudo app using html and css javascript

how to create age calculator in html project

how to make toast in html css and javascript

how to make copy to clipboard in javascript

how to create email validation in javascript

So I hope that you learn about the  Predict the output of following C++ program in cpp And if you have any more queries about computer relegated then feel free to discuss your problem in the comment section.Thank you so much and come back for more updates about Techgsr.co .