screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html> <head> </head> <body> <h1>Javascript Disable Future Date in datepicker</h1> <input type="date" id="datePicker" max="" /> <script> const datePicker = document.getElementById("datePicker"); // Get today's date const today = new Date().toISOString().split("T")[0]; // Set the max attribute to today's date datePicker.setAttribute("max", today); </script> </body> </html>