Code Monkey home page Code Monkey logo

js-todo-app's Introduction

Todo App

A simple todo app using vanilla javascript. This repo is used for teaching in Javascript course.

  • Render todo list
  • Add a new todo
  • Update a todo
  • Remove a todo
  • Search todo
  1. Comment the script sample-solution.js in index.html
  2. Implement logic in main.js to make the todo app works.

Demo: https://paulnguyen-mn.github.io/js-todo-app/

Render todo list

  • Given a list of todos as below:
const todoList = [
  {
    id: 1,
    title: 'Learn JS NEW',
  },
  {
    id: 2,
    title: 'Code JS NEW',
  }
];

TODO: Convert this todo list to list of li which is cloned from todoItemTemplate element. Then append to ul#todoList element.

Add a new todo

  • Handle todo form submit.
  • Build a new todo with title retrieved from user input.
  • Append to todo list.

Edit a todo

  • Fill form values on Edit button click.
  • On form edit submit, update the new value to the corresponding todo item.

Remove a todo

  • Show a confirmation to ask if user wants to process or not?
  • If yes:
    • Remove the todo from the todo list (javascript variable)
    • Remove the li element from ul (dom)

Search a todo

  • Add a new form which is similar to add/edit form having one text field control.
  • When user change the value of the text fields:
    • Search and filter out the todo list whose title contains the search term.

Eg:

  • We have a list of todo: 'Learn JS', 'Study JS'
  • If you input js --> show the two todos.
  • If you input learn --> show only the first one.

Refs

HAPPY CODING! ๐Ÿ˜

js-todo-app's People

Contributors

paulnguyen-mn avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.