I have a page with 5 selects that all have a class name 'ct'. I need to remove the option with a value of 'X' from each select while running an onclick event. My code is:
$(".ct").each(function() {
$(this).find('X').remove();
});
Where am I going wrong?
find()
takes a selector, not a value. This means you need to use it in the same way you would use the regular jQuery function ($('selector')
).Therefore you need to do something like this:
See the jQuery find docs.