sanjar-notes / frontend

The basics - HTML, CSS, Javascript, browser APIs, performance
3 stars 0 forks source link

Form .elements, direct access #107

Open sanjarcode opened 10 months ago

sanjarcode commented 10 months ago

document.querySelector(#my-form-id).elements returns an object keyed by name (on the ). Useful for realtime validation. i.e. don't have to wait until onSubmit is fired (to do event.target.value)