webdevh9.1

<!-- oefening 1 -->

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

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

<body>
		
    <script type="text/javascript">

        var a = 12.345;

        document.write(a);
        document.write('<BR>');    
        document.write('Decimalen: ' + a.toFixed(2));        
        document.write('<BR>');
        document.write('Lengte: ' + a.toPrecision(4));

    </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 a = 'Hello World';
        
        document.write(a.toLowerCase());
        document.write('<BR>');
        document.write(a.toUpperCase());
        
    </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 a = prompt("Vul het 1e getal in");
    	var b = prompt("Vul het 2e getal in");
    
        document.write(a);
        document.write('+');
        document.write(b);
    	document.write('=');
        document.write(parseInt(a) + parseInt(b));
    	 
    </script>

</body>

</html>

Download hier het bestand.