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.
Anweisungen
Select the form and list with querySelector.
Tipp: document.querySelector('#transaction-form')
Wo kommt das hin?
// Listen for submit, prevent the refresh, push an object, and render.Schreib es in Zeile 6 — unter diesem Kommentar, nach dem Code, den du schon ergänzt hast.
Create renderTransactions and render array items with map.
Listen for submit and call preventDefault.
Push a transaction object and render again.
Dein Code
Beschreibe, was du für diesen Schritt bauen willst, und ich schreibe den Code — klicke dann auf Übernehmen, um ihn in deinen Editor zu übertragen. Dieser Schritt: Select the form and list with querySelector.