jQuery remove selected option from this jQuery remove selected option from this jquery jquery

jQuery remove selected option from this


this isn't a css selector.you can avoid spelling the id of this by passing it as a context:

$('option:selected', this).remove();

http://api.jquery.com/jQuery/


 $('#some_select_box').click(function() {     $(this).find('option:selected').remove(); });

Using the find method.


This should do the trick:

$('#some_select_box').click(function() {  $('option:selected', this ).remove();});