Kurs i webprogrammering

Kurs i webprogrammering

    <html>
        <head>
            <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
            <link rel="stylesheet" href="index.css">
        </head>
        <body>
            
            <section id="game">
                <header>
                    <section>
                        <label>Poeng</label>
                        <p id="txtPoeng">20</p>
                    </section>
                    <section>
    * {
        box-sizing: border-box;
        margin: 0;
    }
    html {
        font-size: 100%;
    }
    body {
        background-color: #eee;
        font-family: 'Roboto', sans-serif;
        text-align: center;
    }
    #game {
        width: 25rem;
    const divRegnestykke = document.getElementById("divRegnestykke");
    
    const gameOver = () => {
        console.log("Spillet er over");
    }
    
    const startAnimasjon = () => {
        divRegnestykke.className = "faller";
    }
    
    divRegnestykke.addEventListener("animationend", gameOver);
    
    document.onclick = () => {
        divRegnestykke.className = "";
    const divRegnestykke = document.getElementById("divRegnestykke");
    const txtPoeng = document.getElementById("txtPoeng");
    const inpSvar = document.getElementById("inpSvar");
    
    let fasit = 0;
    let poeng = 0;
    
    const gameOver = () => {
        console.log("Spillet er over");
        inpSvar.disabled = true;
        inpSvar.style.backgroundColor = "pink";
    }
    
    const lagRegnestykke = () => {
    * {
        box-sizing: border-box;
        margin: 0;
    }
    html {
        font-size: 100%;
    }
    body {
        background-color: #eee;
        font-family: 'Roboto', sans-serif;
        text-align: center;
    }
    #game {
        width: 25rem;
    const divRegnestykke = document.getElementById("divRegnestykke");
    const txtPoeng = document.getElementById("txtPoeng");
    const inpSvar = document.getElementById("inpSvar");
    const txtHighscore = document.getElementById("txtHighscore");
    
    let fasit = 0;
    let poeng = 0;
    let varighet = 6;
    let highscore = 0;
    
    if(localStorage.highscore) {
        
        highscore = localStorage.highscore;
        
Kurs i webprogrammering