add options to select box dynamically jquery
$("#selectList").append(new Option("option text", "value"));
add options to select box dynamically jquery
$("#selectList").append(new Option("option text", "value"));
dynamic select option dropdown in jquery
var temp = "myValue";
// Create New Option.
var newOption = $('<option>');
newOption.attr('value', temp).text(temp);
// Append that to the DropDownList.
$('#dptcentres_edit').append(newOption);
// Select the Option.
$("#dptcentres_edit > [value=" + temp + "]").attr("selected", "true");
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us