up
This commit is contained in:
parent
4ae129054e
commit
ab9ab64bd5
476 changed files with 3370 additions and 532 deletions
|
@ -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>
|
|
@ -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>
|
|
@ -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]
|
Loading…
Add table
Add a link
Reference in a new issue