-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
16 lines (15 loc) · 675 Bytes
/
Copy pathapp.js
File metadata and controls
16 lines (15 loc) · 675 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
let btn = document.querySelector("button"); //accessing the div
let ul = document.querySelector("ul"); //accessing the ul
let inp = document.querySelectorAll("input"); //accessing the li
btn.addEventListener("click", function() { //adding event listener to the div
console.log(inp.value);
inp.value=" "; //logging to the console
})
// ul.addEventListener('click', function() { //adding event listener to the ul
// console.log('Ul clicked!'); //logging to the console
// })
// for(li of lis){
// li.addEventListener('click', function() { //adding event listener to the li
// console.log('Li clicked!'); //logging to the console
// })
// }