webdevh7.1

<!-- oefening 1 -->

<!DOCTYPE html>
<html lang="nl">

<head>
    <title>Oefening 1</title>
</head>

<body>

    <script type="text/javascript">
        document.write('Hello World');
        document.write('<BR>');
        document.write(5+5);
    </script>

</body>

</html>


Download hier het bestand.
<!-- oefening 2 -->

<!DOCTYPE html>
<html lang="nl">

<head>
    <title>Oefening 2</title>
</head>

<body>

	<button type="button" onclick="document.write('Hello World')">OK</button>

</body>

</html>


Download hier het bestand.
<!-- oefening 3 -->

<!DOCTYPE html>
<html lang="nl">

<head>
    <title>Oefening 3</title>
</head>

<body>

    <p id="tekst"></p>
    
    <p id="getal"></p>

    <script>
        document.getElementById("tekst").innerHTML = 'Hello World';
        document.getElementById("getal").innerHTML = 5+5;
    </script>

</body>

</html>

Download hier het bestand.
<!-- oefening 4 -->

<!DOCTYPE html>
<html lang="nl">

<head>
    <title>Oefening 4</title>
</head>

<body>

    <button type="button" onclick="laadWaarden()">OK</button>

    <p>Tekst: = <span id="tekst"></span></p>
    <p>Getal: = <span id="getal"></span></p>

    <script>
        function laadWaarden() {
            document.getElementById("tekst").innerHTML = 'Hello World';
            document.getElementById("getal").innerHTML = 5 + 5;
        }
    </script>

</body>

</html>

Download hier het bestand.