JQuery UI selectmenu is not a function

I am trying to create an HTML selection menu using jQuery UI; but it just doesn't work. Here is the JSFiddle . Below are examples of what I'm trying to accomplish.

Here is my HTML code:

<form action="#">
    <fieldset>
        <label for="parameterSelectMenu">Select a Parameter</label>
        <select name="parameterSelectMenu" id="parameterSelectMenu">
            <option value="volvo">Temperature Actual</option>
        </select>
    </fieldset>
</form>
<!-- A button to show JQuery is working... -->
<button id="clicker">A button element</button>

Here's the javascript:

$("#clicker").button();
$("#parameterSelectMenu").selectmenu();

In Firefox, "selectmenu" is reported as not a function ...

+4
source share
1 answer

FIDDLE updated . The problem is that you are using the old version jquery-uiin the jsfiddle created demo, which does not support selectmenu plugin.

so you need to add the latest version plugin files as shown below:

<link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script>
+5

Source: https://habr.com/ru/post/1547011/


All Articles