-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10app.js
More file actions
24 lines (20 loc) · 817 Bytes
/
10app.js
File metadata and controls
24 lines (20 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const form = document.querySelector("form");
const taskInput = document.getElementById("task");
// form.addEventListener("submit", runEvent);
// Keyboard events
// taskInput.addEventListener("keydown", runEvent);
// taskInput.addEventListener("keyup", runEvent);
// taskInput.addEventListener("keypress", runEvent);
// taskInput.addEventListener("focus", runEvent);
// taskInput.addEventListener("blur", runEvent);
// taskInput.addEventListener("cut", runEvent);
// taskInput.addEventListener("paste", runEvent);
// Input event
taskInput.addEventListener("input", runEvent);
// change event is also available if you have select list
// select.addEventListener('change',runEvent);
function runEvent(e) {
console.log(`EVENT TYPE: ${e.type}`);
// console.log(taskInput.value);
console.log(e.target.value);
}