I have a dropdown menu that is populated with snacks' names. the last option of the dropdown menu is for adding new snack and it works fine using jQuery. but all I want to know is if I can remove an option from dropdown menu. My imagination is like displaying a small delete icon in front of the option text on hovering on that option and be able to delete the option by clicking on it's delete button.
You can use remove:
$("#snackdropdown option[value='SnackName']").remove();
Where #snackdropdown is the name of your drop down list and 'SnackName' is the item you wish to remove.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With