Level 75
See my answer here: https://laracasts.com/discuss/channels/laravel/need-help-with-datepicker
I use an id.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
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">
<head>
<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>
<script>
$( function() {
$( "#datepicker" ).datepicker();
} );
</script>
</head>
<body>
Date: <div id="datepicker"></div>
Please or to participate in this conversation.