Javatpoint Logo

91-9990449935

 0120-4256464

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.

Option Description
appendTo It is used to append the menu. Its default value is NULL.
disabled If you set this option to true, it disables the Selectmenu. Its default value is FALSE.
icons This option is used to specify a button.
position It identifies the position of the menu in relation to the associated button element.
width It 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.

Action Description
close This method is used to close the menu. It does not accept any argument.
destroy It is used to remove the Selectmenu functionality completely and return the element back to its pre-init state. It does not accept any argument.
disable It is used to disable the Selectmenu functionality. It does not accept any argument.
enable It is used to enable the Selectmenu. It does not accept any argument.
instance This method retrieves the instance object of Selectmenu. It does not accept any argument.
menuWidget It returns the jQuery object containing the menu element. It does not accept any argument.
open It is used to open the menu. It does not accept any argument.
option It gets an object having the key/value pairs specifying the current Selectmenu options hash.
refresh It is used to parse the original element and re-render the menu. It does not accept any argument.
widget It returns a jQuery object having the button element.
Next TopicjQuery UI Slider