How can I remove duplicate values -> drop down option elements? I have the following HTML:
All Servers
HTML
All Servers http://smiles.com http://3smiles.com http://desk.com http://france24.com
jQuery
var seen = {}; jQuery('.something').children().each(function() { var txt = jQuery(this).attr('value'); if (seen[txt]) { jQuery(this).remove(); } else { seen[txt] = true; } });
Demo