4 ms·
You can access forms using `document.forms.$name`. Form needs to have `name` attribute set, though. You can also access input elements using `form.elements.$in
by abdusco 6y ago
You can access forms using `document.forms.$name`. Form needs to have `name` attribute set, though.
You can also access input elements using `form.elements.$inputName`.
<form name="contact">
<input name="message"/>
</form>
this form can be accessed directly using
const form = document.forms.contact
const message = form.elements.message