I am trying to build a parameter set for a select element using jQuery. It works, with the exception of the data attribute, which should be included, which seems to be omitted.
Here is my code:
// cJ is JSON object. // #currency is my select element. function makeCurDropDown(cJ) { $.each(cJ, function (i) { $('#currency').append( $('<option></option>').val(i).data("sym", cJ[i][0]).html(cJ[i][1]) ); }); }
source share