27 lines
595 B
HTML
27 lines
595 B
HTML
|
<!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>
|