screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <script> function displayLastTwoDigits() { var currentDate = new Date(); var fullYear = currentDate.getFullYear(); var lastTwoDigits = fullYear % 100; document.getElementById('lastTwoDigits').textContent = "Last two digits of the year: " + lastTwoDigits; } </script> </head> <body> <h1>Javascript Get Last Two Digits of Current Year</h1> <p id="lastTwoDigits"></p> <button onclick="displayLastTwoDigits()">Display Last Two Digits</button> </body> </html>