Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- let checkButton = document.querySelector('button');
- checkButton.addEventListener('click', () => {
- let year = Number(document.querySelector('input').value);
- let isLeap = 'Not Leap Year';
- if (year !== 0 && (((year % 4 === 0) && (year % 100 !== 0)) || year % 400 === 0)) {
- isLeap = 'Leap Year';
- }
- document.querySelector('#year h2').textContent = isLeap;
- document.querySelector('#year div').textContent = year;
- document.querySelector('input').value = '';
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement