The DOM and an interactive transaction form
Let a person use the ledger
The DOM is the browser's object model for the page. JavaScript can listen for a form submission, read its fields, update application state, and render the new result.
This is the turning point: Smart Ledger stops being a script and becomes an application.
Инструкции
Select the form and list with querySelector.
Подсказка: document.querySelector('#transaction-form')
Куда это писать?
// Listen for submit, prevent the refresh, push an object, and render.Пишите в строке 6 — под тем комментарием, после уже добавленного кода.
Create renderTransactions and render array items with map.
Listen for submit and call preventDefault.
Push a transaction object and render again.
Ваш код
Опишите, что хотите создать на этом шаге, и я напишу код — затем нажмите «Применить», чтобы вставить его в редактор. Текущий шаг: Select the form and list with querySelector.