I have array of select tag.
<select id='uniqueID' name="status">
<option value="1">Present</option>
<option value="2">Absent</option>
</select>
and I want to create a json object having two fields 'uniqueIDofSelect and optionValue' in JavaScript.
I use getElementsByName("status") and I iterate on it.
EDIT
I need out put like
[{"selectID":2,"OptionValue":"2"},
{"selectID":4,"optionvalue":"1"}]
and so on...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…