I’m trying to get all form elements to array, then loop through them using jquery’s $.each() function and within this function get each element’s id, and title attributes.
I’ve tried serializeArray(), but I can only get ‘name’ and ‘value’ attributes.
I need something that collects all form elements whether it’s input (regardless of the type), select, textarea, and regardless whether it has value, is checked or hidden.
Perhaps something like $(‘#form_id’).find(‘input select textarea’); ?
Any idea how to achieve this?
Use:
It will return a nodeList containing all form-elements.
<edit>
Please Note: the elements-collecttion may also contain elements like fieldset or object, See: http://www.w3.org/TR/html5/forms.html#category-listed
</edit>