Leapyear

Hi! I am struggling with making a program that will tell if the year the user puts in, is a leapyear or not. Can someone help me with the code? The user is supposed to put in a number. Its in my native language btw…

</body>
</html>
Skriv inn årstall:
<p></p>
     <input type="text" placeholder="Årstall" id="year">
<p></p>
     <button id="knapp">Er det skuddår?</button>

<style>
</style>

<script src="">
    
  document.getElementById("year").addEventListener("click",skuddÅr(year))  
    
    
    function skuddÅr(year){
         if (year % 4===0){
             
         if (year % 100===0){
      
         if (year % 400===0){
      
 'Året ${year} er et skuddår!' 
  } else {
    return 'Året ${year} er ikke et skuddår!'
  }  
  } else {
    return 'Året ${year} er et skuddår!'
  }
    else{
    return 'Året ${year} er ikke et skuddår'
  } 
        
  }

The conditions are correct but the bracketing seems off. You can also add a constraint for 1752 if you plan on taking input that goes far that back.

Also when printing strings with variables inside them you want to use the backtick ` like so

`Året ${year} er et skuddår!`

instead of 
'Året ${year} er et skuddår!'

how do you get that with out the color?

Hi, color should not matter if the code works. Different text editors will render the color of the code differently (not to be confused with the color of the output of a webpage).