loops uke 5
This commit is contained in:
parent
484bde716b
commit
69ce8cd8a6
5 changed files with 128 additions and 2 deletions
27
oppgaver/uke5/loops-2gangen.html
Normal file
27
oppgaver/uke5/loops-2gangen.html
Normal file
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<button onclick="updateview()">Print nummer</button>
|
||||
</div>
|
||||
<script>
|
||||
function updateview() {
|
||||
for (let i = 1; i < 21; i++) {
|
||||
if (i % 2 == 0){
|
||||
document.getElementById('app').innerHTML += /*HTML*/ `
|
||||
<ul>${i}</ul>
|
||||
`;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue