I have the following json object.
var json1 = {"00" : "00", "15" : "15", "30" : "30", "45" : "45"};
I am preparing a select element that parses the above json as follows.
var selElem = $('<select>', {'name' : name, 'grp' : grp}); for(key in json1) selElem.append($('<option>', {value:key, text: json1 [key]}));
but the created select element looks like this.
<select> <option value="15">15</option> <option value="30">30</option> <option value="45">45</option> <option value="00">00</option> </select>
The problem here is that the json1 object contains 00 as the 1st element, but in the select element it is finally created.
Any work or solution to this problem.
source share