Get Jquery Date-picker value in Java-script Function
Dear All,
I am having a form which consists of html controls(Text-box,dropdown..etc) along with query date-picker control ,As the jquery date-picker control is compatible for all the browsers
And I had written the java-script in a function which gets all the values of controls existing in the form ,But I found no luck to get the date-picker value .
Can any one please help me in getting the value of data-picker in function
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>click demo</title>
- <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
- <script src="//code.jquery.com/jquery-1.10.2.js"></script>
- <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css">
- </head>
- <body>
- <p>Date:
- <input type="text" id="datepicker">
- </p>
- <button id="button" type="button">Click Me!</button>
- <script>
-
- function getvalue()
- {
- $("#datepicker").datepicker()
- var x=($("#datepicker").datepicker("getDate"));
- alert(x);
-
- }
- </script>
- </body>
- </html>
Thanks
SID