Remove selected option from select menu
I have select menu with options
Veg
Fruits
Meal
i want to remove 'Veg' option from select menu.
my select menu is filled by service.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
I have select menu with options
Veg
Fruits
Meal
i want to remove 'Veg' option from select menu.
my select menu is filled by service.
Hello! If Veg it's a label of the option you can use the following JS:
codeAppery("mobileselectmenuName").find("option").each(function(){
var $this = $(this);
if ($this.text().trim()=="Veg") {
$this.remove();
}
});
Appery("mobileselectmenuName").selectmenu('refresh');/code
If Veg it's a value of the option then use this JS:
codeAppery("mobileselectmenuName").find("option[value=Veg]").remove();
Appery("mobileselectmenuName").selectmenu('refresh');/code
where mobileselectmenuName - Select name