UID UID - 2 months ago 33
HTML Question

jQuery Spinner not working, shows a normal textbox instead

I am using jQuery Spinner to show a textbox with increment/decrement options.

For now, I have written very basic code to create the spinner.

HTML



<input id="spinner" name="value">


jQuery



<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

<script>
$(function() {
$(".spinner").spinner();
});
</script>


Here’s a jsFiddle.

After rendering on the page, it shows a plain textbox, and in the console, I get these errors:



  • ReferenceError:
    jQuery
    is not defined

    })( jQuery );

  • TypeError:
    $(...).spinner
    is not a function

    $("#spinner").spinner();




Have I forgotten to call some extra jQuery, or something else?

Answer

You haven't selected a jquery library.You need to select appropriate Jquery framework for you .

If your other frameworks are using jquery you must include the jquery library befoore including other libraries

enter image description here

$(document).ready(function() {
     $("#spinner").spinner();
 });

DEMO

Comments