How can I check whether a option already exist in select by JQuery
Another way using jQuery:
var exists = false;
$('#yourSelect option').each(function(){
if (this.value == yourValue) {
exists = true;
}
});
This evaluates to true if it already exists:
$("#yourSelect option[value='yourValue']").length > 0;
if ( $("#your_select_id option[value=<enter_value_here>]").length == 0 ){
alert("option doesn't exist!");
}