Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Add and Remove Options in Select using jQuery
$("#selectBox").append('<option value="option6">option6</option>');
$.each(selectValues, function(key, value) {
<select id="selectBox" name="selectBox">
<option value="option1"> option1 </option>
<option value="option2"> option2 </option>
<option value="option3"> option3 </option>
<option value="option4"> option4 </option>
$("#selectBox option[value='option1']").remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment