123456/pt javascript/H1_frisoderuiter_V4.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>
<script>
window.onload = maakEvents;
function maakEvents(){
document.getElementById("knop").onclick = verwijder;
}
function verwijder(){
this.innerHTML = "Toon Omschrijving"
document.getElementById("omschrijving").style.display = "none";
document.getElementById("omschrijving1").style.display = "none";
document.getElementById("omschrijving2").style.display = "none";
}
</script>
</head>
<body>
<button id="knop">Verwijder Omschrijving.</button>
<p>Coca Cola</p>
<div id="omschrijving">Een koolzuurhoudende frisdrank.</div>
<p>Pepsi Cola</p>
<div id="omschrijving1">Een koolzuurhoudende frisdrank.</div>
<p>Sprite</p>
<div id="omschrijving2">Een koolzuurhoudende frisdrank.</div>
</body>
</html>
Resultaat
Made by Thijs Aarnoudse