How can I remove duplicate values -> drop down option elements? I have the following HTML:
All Servers
How about this.
DEMO :http://jsfiddle.net/naokiota/yayTm/2/
var exist = {}; $('select > option').each(function() { if (exist[$(this).val()]){ $(this).remove(); }else{ exist[$(this).val()] = true; } });
Hope this helps.