jQuery UI Selectmenu

jQuery UI Selectmenu is used to extend the functionality of a native HTML select element. It provides the customization functionality in behavior and appearance far beyond the limitation of a native select.

The jQuery UI Selectmenu widget provides a proper replacement of select element and act as a proxy back to the original select element controlling its state for form submission or serialization.

Example of jQuery UI selectmenu() method

Let's take a simple example to demonstrate the functionality of Selectmenu.

Test it Now

Following is a list of different options that can be used with this method.

OptionDescription
appendToIt is used to append the menu. Its default value is NULL.
disabledIf you set this option to true, it disables the Selectmenu. Its default value is FALSE.
iconsThis option is used to specify a button.
positionIt identifies the position of the menu in relation to the associated button element.
widthIt specifies the width of the menu in pixels. Its default value is NULL.

Initialize the Selectmenu with the disabled options specified:

Let's take an example to demonstrate the above table options. The following example specifies how to use the disabled option in the jQuery UI Selectmenu example.

There are two ways to use the option "disable":

1) Get the disable option:

1) Set the disable option:

jQueryUI selectmenu() example 2

In the following example, we are using set method:

Let's take an example to demonstrate the usage of selectmenu().

Test it Now

Following is a list of different actions (methods) that can be used with this jQueryUI Selectmenu method.

ActionDescription
closeThis method is used to close the menu. It does not accept any argument.
destroyIt is used to remove the Selectmenu functionality completely and return the element back to its pre-init state. It does not accept any argument.
disableIt is used to disable the Selectmenu functionality. It does not accept any argument.
enableIt is used to enable the Selectmenu. It does not accept any argument.
instanceThis method retrieves the instance object of Selectmenu. It does not accept any argument.
menuWidgetIt returns the jQuery object containing the menu element. It does not accept any argument.
openIt is used to open the menu. It does not accept any argument.
optionIt gets an object having the key/value pairs specifying the current Selectmenu options hash.
refreshIt is used to parse the original element and re-render the menu. It does not accept any argument.
widgetIt returns a jQuery object having the button element.




Latest Courses