webdevh11.1

<!-- oefening 1 -->

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

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

<body>

    <script type="text/javascript">
        var i;

        for (i = 1; i <= 10; i++) {
            document.write(i);
            document.write('<BR>');
        }
    </script>

</body>

</html>

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

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

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

<body>

    <script type="text/javascript">
        var Tekst = 'Hello World';
        var Letter;

        for (Letter of Tekst) {
            document.write(Letter);
            document.write('<BR>');
        }
    </script>

</body>

</html>

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

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

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

<body>

    <script type="Text/javascript">    
    	var Tekst = ""
		var i = 0;
    
    	do {
  			Tekst += i;
  			i++;
		}
		while (i < 10);
		
		document.write(Tekst);
    </script>

</body>

</html>

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

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

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

<body>
    
    <script type="text/javascript">	
 		var dagen = ["Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrijdag", "Zaterdag", "Zondag"]; 
        var i = 0; 
        var Tekst = ""; 

		while (dagen[i]) {
  			Tekst += dagen[i] + "<br>";
  			i++;
		}
 
 		document.write(Tekst); 
    </script>

</body>

</html>

Download hier het bestand.