Published
Edited
Oct 15, 2021
5 stars
Insert cell
Insert cell
html`<h3>The text below can be hidden or showen by clicking the button.</h1>
<button id="butt" onclick=${() => {
document.getElementById("_text").hidden = document.getElementById("_text").hidden? false : true;
let btext = document.getElementById("_butt").innerText;
document.getElementById("_butt").innerText = (btext[0] == 'H')? btext.replace("Hide","Show") : btext.replace("Show","Hide");
}
}>Hide the text</button>
<div id='_text'>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>
<hr>
`
Insert cell
html`<h3>Start with text hidden:</h3>
<button id="light1_butt" onclick=${() => {
document.getElementById("light1_text").hidden = document.getElementById("light1_text").hidden? false : true;
let btext = document.getElementById("light1_butt").innerText;
document.getElementById("light1_butt").innerText = (btext[0] == 'H')? btext.replace("Hide","Show") : btext.replace("Show","Hide");
}
}>Show the text</button>
<div id='light1_text' hidden>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</div>`
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more