CMT3 - Herhalingsoefening 03
How do I make an cmt3 - herhalingsoefening 03?
What is a cmt3 - herhalingsoefening 03? How do you make a cmt3 - herhalingsoefening 03? This script and codes were developed by Samuel on 10 November 2022, Thursday.
CMT3 - Herhalingsoefening 03 - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CMT3 - Herhalingsoefening 03</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <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>
CMT3 - Herhalingsoefening 03 - 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;
}
CMT3 - Herhalingsoefening 03 - Script Codes JS Codes
function main() { //elementen opvragen var divs = document.getElementsByTagName('div'); var span = document.getElementsByTagName('span')[0]; //randomize function function randomize() { return Math.floor((Math.random() * 9)); } function setMole() { //loop voor alle divs for (var i = 0; i < divs.length; i++) { //op voorwaarde dat het element de class 'rood' heeft... if (divs[i].className === 'rood') { //alle divs verliezen de class 'rood' divs[i].classList.remove('rood'); } } //geeft div met een random index de class 'rood' divs[randomize()].classList.add('rood'); } //voert de function 'setMole' elke halve seconde uit setInterval(setMole, 500); //loop voor alle divs for (var i = 0; i < divs.length; i++) { //onlclick function divs[i].onclick = function() { //op voorwaarde dat het aangeklikte element de class 'rood' heeft... if (this.className === 'rood') { span.innerHTML++; } } }
}
window.onload = function() { main();
}
Developer | Samuel |
Username | SamuelVDP |
Uploaded | November 10, 2022 |
Rating | 3 |
Size | 2,197 Kb |
Views | 14,168 |
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!
Name | Size |
CMT3 - Opdracht 02 - OBEY | 5,499 Kb |
IT3 - Opdracht 09 - RellaxJS | 4,331 Kb |
IT3 - Opdracht 03 - FreshCotton | 2,754 Kb |
IT3 - Opdracht 05 - Battery API | 3,894 Kb |
IT2 - Vault | 2,673 Kb |
IT3 - Opdracht 04 - Responsive Weekplanner | 3,898 Kb |
CMT3 - Opdracht 06 - Isotope | 3,686 Kb |
IT3 - Opdracht 01 - Drop The Needle | 6,566 Kb |
CMT3 - Herhalingsoefening 02 | 2,246 Kb |
IT3 - Opdracht 06 - PureCSS | 5,220 Kb |
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!
Name | Username | Size |
Canvas Fireworks | Jackrugile | 6,200 Kb |
Content Changer | Cliffpyles | 4,538 Kb |
After America | Jonathangarner | 2,686 Kb |
BlueBox Fork | Huskynation | 12,675 Kb |
RPG Style Text Dialogue | Odylic | 2,635 Kb |
Parallax-ish Sliding Content | Jdsteinbach | 2,748 Kb |
Animated skewed panes | NyX | 4,462 Kb |
Intake Form Page 2 | Ijantje | 4,983 Kb |
SCSS Simple Animated Drop-In | Danwarfel | 2,175 Kb |
Mapbox Directions with geolocation tracking | Pollardld | 5,827 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!