Skip to content
Discussion options

You must be logged in to vote

@Vlad991 :

According to HTML specification, accessing form elements will follow this behavior:

You can access the list of the form's data-containing elements by examining the form's elements property. This returns an HTMLFormControlsCollection listing all of the form's user data entry elements, both those which are descendants of the form and those which are made members of the form using their form attributes.

You can also get the form's element by using its name attribute as a key of the form, but using elements is a better approach—it contains only the form's elements, and it cannot be mixed with other attributes of the form.

While "react-hook-form" is using "field.closest('form').…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@bluebill1049
Comment options

@JamesWong1999
Comment options

Answer selected by Vlad991
Comment options

You must be logged in to vote
2 replies
@Vlad991
Comment options

@bluebill1049
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants