Published
Edited
Jul 4, 2022
2 stars
Also listed in…
Tips and Utilities
Insert cell
Insert cell
Insert cell
aa = import("@formkit/auto-animate")
Insert cell
output = html`<div id="dropdown" class="dropdown">
<strong class="dropdown-label">
Click me to open!
</strong>
</div>`
Insert cell
Insert cell
p = document.createElement('p')
Insert cell
{
dropdown.querySelector("strong").addEventListener("click", ()=>{
toggle()
})
aa.default(dropdown)
p.innerText = `Sea of Tranquility a mote of dust suspended in a sunbeam hundreds of thousands concept of the number one realm of the galaxies radio telescope. As a patch of light descended from astronomers two ghostly white figures in coveralls and helmets are softly dancing emerged into consciousness Orion's sword encyclopaedia galactica. Another world bits of moving fluff network of wormholes muse about network of wormholes with pretty stories for which there's little good evidence and billions upon billions upon billions upon billions upon billions upon billions upon billions.`


}
Insert cell
function toggle () {
dropdown.contains(p) ? p.remove() : dropdown.appendChild(p)
}
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