MGS
MGS

Reputation: 456

Jquery Datepicker function

unstyled and strange datepickerI'm trying to get the datepicker to work in firefox using JS.

Here is my simple code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

<script>
  $(function() {
    $('input[type=date]').datepicker({
      dateFormat: 'yy-mm-dd'
    });
  });
</script>

I keep getting the error that datepicker is not a function. What seems to be wrong?

Kind regards

Upvotes: 0

Views: 535

Answers (1)

NikNik
NikNik

Reputation: 2301

You need datepicker.js too:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/datepicker/0.5.4/datepicker.js"></script>

<script>
  $(function() {
    $('input[type=date]').datepicker({
      dateFormat: 'yy-mm-dd'
    });
  });
</script>

Upvotes: 3

Related Questions