| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5dc8cb2 commit ddbb0b5
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,3 +7,18 @@ list.addEventListener('click', (e) => { | |||
| 7 | 7 | li.parentNode.removeChild(li); | |
| 8 | 8 | } | |
| 9 | 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); | ||
| 24 | + }); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments