31 lines
736 B
HTML
31 lines
736 B
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>Document</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<p id="szokoev"></p>
|
||
|
<script>
|
||
|
let ev = parseInt(prompt("Add meg az évet!"));
|
||
|
let szoko = szokoev(ev);
|
||
|
|
||
|
function szokoev(ev) {
|
||
|
if ((ev % 4 == 0 && ev % 100 != 0 )|| ev % 400 == 0){
|
||
|
return true;
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
let nem = "";
|
||
|
if(!szoko){
|
||
|
nem = "NEM";
|
||
|
}
|
||
|
document.getElementById("szokoev").innerHTML = `A megadott év (${ev}) ${nem} szökőév!`;
|
||
|
//console.log(szoko);
|
||
|
|
||
|
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|