Webbserverprogrammering 1

Show sourcecode

The following files exists in this folder. Click to view.

public_html/exercises/

Projekt/
cm.html
formPostTest/
index.html
javascript.html
ovning0.html
ovning01.html
ovning02.html
ovning03.html
ovning04.html
ovning06.html
ovning07.html
ovning08.html
ovning09.css
ovning09ap.html
ovning09app.html
ovning09ba.html
ovning10.html
ovningjs02.html
piano.html
quizeovning.php
spel.html
test.html

javascript.html

27 lines ASCII Windows (CRLF)
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Javascript</title>
    <style>
        #button1 {
            position: absolute;
        }
    </style>
</head>
<body>
    <button type="button" id="button1">lallish</button>
    <script>
        var topVar = 10;
        document.getElementById('button1').addEventListener('click', jsfunction);

        function jsfunction() {
            xGoal = Math.random()*100
            yGoal = Math.random()*100
            document.getElementById('button1').style.top = Math.random()*100 + "%";
            document.getElementById('button1').style.left = Math.random()*100 + "%";
        }
    </script>
</body>
</html>