Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>TODO app</title>
- </head>
- <body>
- <h2>ToDo List</h2>
- <input placeholder="Type Here" id="item">
- <button onclick="addItem()">Add</button>
- <div>
- <ol id="itemList">
- </ol>
- </div>
- <script type="text/javascript">
- function addItem(){
- var item = document.getElementById("item");
- var newItem = document.createElement('li');
- newItem.textContent = item;
- var list = document.getElementById("itemList");
- list.appendChild(newItem);
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement