Convert form data to JavaScript object with jQuery
Asked 07 September, 2021
Viewed 1.7K times
  • 57
Votes

How do I convert all elements of my form to a JavaScript object?

I'd like to have some way of automatically building a JavaScript object from my form, without having to loop over each element. I do not want a string, as returned by $('#formid').serialize();, nor do I want the map returned by $('#formid').serializeArray();

30 Answer