FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

11 Lesson · DevNexS/JavaScript-DOM-Tutorial@59a989a · GitHub

Repository navigation

Commit 59a989a

Browse files
committed
11 Lesson
1 parent f6b9b44 commit 59a989a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎app.js‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,19 @@ list.addEventListener('click', (e) => {
66
const li = e.target.parentElement;
77
li.parentNode.removeChild(li);
88
}
9+
});
10+
11+
const forms = document.forms;
12+
console.log(forms);
13+
console.log(forms['add-book']);
14+
15+
Array.from(forms).forEach(function(form){
16+
console.log(form);
17+
});
18+
19+
const addForm = forms['add-book'];
20+
addForm.addEventListener('submit', function(e){
21+
e.preventDefault();
22+
const value = addForm.querySelector('input[type="text"]').value;
23+
console.log(value);
924
});

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL