I need help understanding the JQuery DatePicker widget examples here:
https://api.jqueryui.com/datepicker/#entry-examples
First of all, in JQuery, what's the difference between
$(...).
and
$.
I understand,
$(".xxx") selects elements with class xxx
$("#xxx") will select an element with id xxx
$(button) selects button elements
But I don't understand, $.
The explanation here made no sense to me:
In the examples on the JQuery datepicker tutorial, what is this:
$.datepicker.
What is this:
$( ".selector" ).
Is it saying that some element with the class, "selector" has a datepicker object in it?
But then, when I try this, it only shows the input element:
<div><input class="test">
<script>
$( ".test" ).datepicker("show")
</script>
Even though this works:
$( ".test" ).hide();
That's from the show() example in:
https://api.jqueryui.com/datepicker/#entry-examples
How would code like:
$( ".selector" ).datepicker( "show" );// and
$.datepicker.parseDate( "yy-mm-dd", "2007-01-26" )
work in a full example like in this context:
<body> <div id="datepicker"></div> <script>$( "#datepicker" ).datepicker();</script> </body>
thanks in advance
jQuery (Core) is a cross-browser JavaScript library that provides abstractions for common client-side tasks such as Document Object Model (DOM) traversal, DOM manipulation, event handling, animation and Ajax. jQuery also provides a platform to create plugins that extend jQuery's capabilities beyond those already provided by the library.
TRUSTED BY
ASKER
Thanks you.
But in the datepicker documentation, what is $( ".selector" )
For example, is
$( ".selector" ).datepicker( "show" );
an abstract way of showing something like,
$( "myDateDiv" ).datepicker( "show" );
Because when I try it, this works:
$( "#myDateDiv" ).datepicker();
But this does nothing:
$( "#myDateDiv" ).datepicker("show");