This commit is contained in:
Ilya Kantor 2017-03-21 14:41:49 +03:00
parent 4ae129054e
commit ab9ab64bd5
476 changed files with 3370 additions and 532 deletions

View file

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<input type="button" id="hider" value="Click to hide the text" />
<div id="text">Text</div>
<script>
// Here it doesn't matter how we hide the text,
// could also use style.display:
document.getElementById('hider').onclick = function() {
document.getElementById('text').hidden = true;
}
</script>
</body>
</html>

View file

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<input type="button" id="hider" value="Click to hide the text" />
<div id="text">Text</div>
<script>
/* your code */
</script>
</body>
</html>

View file

@ -0,0 +1,11 @@
importance: 5
---
# Hide on click
Add JavaScript to the `button` to make `<div id="text">` disappear when we click it.
The demo:
[iframe border=1 src="solution" height=80]