Using css class as variable
I have a question about the proper syntax for using a css class as a variable.
I tried this and it's working great...
function populate_NC(countyClass) {
$('.' + countyClass).append('<option value="Select">--Select One--</option>');
$('.' + countyClass).append('<option value="Alamance County">Alamance</option>');
$('.' + countyClass).append('<option value="Alexander County">Alexander</option>');
...
}
But I'd like to use the same concept to remove the counties from the list. Currently I have this, which is working fine, but I'd like to replace with the variable:
$("'.countyMailingDropDown' > option").remove();
I've tried a few variations of quotation marks, but haven't yet been successful. Any thoughts?
$(" '.' + countyClass > option").remove(); ///not working!
Thanks for any help!