Getting all of a form's elements with JS

 

You can get all of the elements in the form by getting the form itself, and then by using elements property having it.

var form = document.querySelector('#someForm');
var elements = form.elements;

Tags:

Share:

Related posts