1 month ago

How to add click event of date: jquery datepicker

Posted 1 month ago by david001

Hi, how can I add a click event to the days of this calendar? It shows all the days of this month of May 2020, Now when I click any date it should show me today's date as 2020-5-24. I want to send ajax request and get data based on today's date.

<html lang="en">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Datepicker - Display inline</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
  <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"defer></script>
  $( function() {
    $( "#datepicker" ).datepicker();
  } );
Date: <div id="datepicker"></div>

Please sign in or create an account to participate in this conversation.