How to collect values of HTML input elements into a map-like object? – Javascript
I have input elements like this: <input name="fruit" id="fruit" value="Orange"> <input name="vegetable" id="vegetable" value="Spinach"> <input name="dairy" id="dairy" value="Eggs"> <input name="bread" id="bread" value="Bread"> <input name="soup" id="soup" value="Soup"> I need to get them all and create an object like this: { fruit:…