You need to set up the menu from Wordpress admin.
Aug 11, 2011

Retrieving optgroup label for selected option in a drop down list with Mootools

Just a quick tip for getting the selected option optgroup label using Mootools:


<select id="transport">
    <optgroup label="Cars">
    <optgroup label="Motorbikes">

Mootools JavaScript:

// get optgroup label of selected option on change"transport").addEvent("change",function(){
    var optGroup=this.getSelected().getParent("optgroup").get("label");
    // do something with the label

Leave a comment