Good points! Another nice vanilla-JavaScript way to get data from all the inputs in one object, useful for sending to an API, is by using:
const data = Object.fromEntries(new FormData(event.target))
thanks! good trick i'll probably use in future.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good points! Another nice vanilla-JavaScript way to get data from all the inputs in one object, useful for sending to an API, is by using:
thanks! good trick i'll probably use in future.