I am developing a web app in which I remove all elements from a select, using:
$('#State option').each(function(i, option){ $(option).remove(); });
How can I use the this keyword instead of ‘#State’?
From OP comment:
I have multiple drop down elements. When focusing it, I have to call one function which deletes all elements from currently selected drop down
I don’t know if that’s good UI design, but assuming it’s needed…