CMP5-Opdracht5

Size
1,990 Kb
Views
36,432

How do I make an cmp5-opdracht5?

What is a cmp5-opdracht5? How do you make a cmp5-opdracht5? This script and codes were developed by Sanne Van Gastel on 30 July 2022, Saturday.

CMP5-Opdracht5 Previews

CMP5-Opdracht5 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CMP5-Opdracht5</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>	<div></div>	<div></div>	<div></div>	<div></div>	<div></div>	<div></div>	<div></div>	<div></div>	<div></div>	<p>Spelletje mollen vangen: <span id="molletjes">0</span> mollen gevangen</p> <script src="js/index.js"></script>
</body>
</html>

CMP5-Opdracht5 - Script Codes CSS Codes

div { box-sizing: border-box; border: 1px solid black; width: 100px; height: 100px; float: left; margin-right: 10px; margin-bottom: 10px;}
div:nth-child(3), div:nth-child(6), div:nth-child(9) {margin-right: 0;}
body { width: 320px; margin: 50px auto;}
.rood { background-color: red;}
p { display: inline; font-family: "helvetica neue"; color: darkgrey;}

CMP5-Opdracht5 - Script Codes JS Codes

function main() { var myDiv = document.getElementsByTagName('div'); random ();
}
var random = function () { var myMol = document.getElementById('molletjes'); var getal = Math.floor((Math.random() * 10)); var myDiv = document.getElementsByTagName('div'); myDiv[getal].setAttribute('class', 'rood'); for (var i=0; i<9; i++){ if(i!=getal){ myDiv[i].setAttribute('class', ''); } } myDiv[getal].onclick = function(){ myMol.innerHTML++; } }
window.onload = function() { setInterval(main, 1500);
}
CMP5-Opdracht5 - Script Codes
CMP5-Opdracht5 - Script Codes
Home Page Home
Developer Sanne Van Gastel
Username SannevanGastel
Uploaded July 30, 2022
Rating 3
Size 1,990 Kb
Views 36,432
Do you need developer help for CMP5-Opdracht5?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Sanne Van Gastel (SannevanGastel) Script Codes
Create amazing captions with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!