Shahrukh Badar
Posts: 0
Joined: Sun May 19, 2013 6:45 am

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.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Remove selected option from select menu

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

Return to “Issues”