Created
April 30, 2020 23:05
-
-
Save amitgupta15/5f6a820f0087f020e8b04727ca7468d0 to your computer and use it in GitHub Desktop.
Javascript Testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('submit', function (event) { | |
event.preventDefault(); | |
var elements = document.querySelector('#aform').elements; | |
var todoItem = elements['todo-input'].value; | |
var todoList = document.querySelector('#todo-list'); | |
if (todoItem) { | |
todoList.innerHTML += '<li>' + todoItem + '</li>'; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment