Skip to main content
added 18 characters in body; deleted 22 characters in body
Source Link
keios
  • 460
  • 4
  • 10

You can just iterate over your json array with the following code

$('<option/>').attr("value","someValue").text("Option1").appendTo("#my-select-id");

You can just iterate over your json array with the following code

$('<option/>').attr("value","someValue").text("Option1").appendTo("#my-select-id");

You can just iterate over your json array with the following code

$('<option/>').attr("value","someValue").text("Option1").appendTo("#my-select-id");

added 4 characters in body; deleted 2 characters in body; added 73 characters in body
Source Link
keios
  • 460
  • 4
  • 10

$("").attr("value","someValue").text("Option1").appendTo("#my-select-id");You can just iterate over your json array with the following code

$('<option/>').attr("value","someValue").text("Option1").appendTo("#my-select-id");

$("").attr("value","someValue").text("Option1").appendTo("#my-select-id");

You can just iterate over your json array with the following code

$('<option/>').attr("value","someValue").text("Option1").appendTo("#my-select-id");

Source Link
keios
  • 460
  • 4
  • 10

$("").attr("value","someValue").text("Option1").appendTo("#my-select-id");