Published
Edited
Dec 24, 2019
Importers
4 stars
Insert cell
Insert cell
viewof x = startStop()
Insert cell
x
Insert cell
startStop = () => {
const buttons = html`
<form>
<input value="start" type="button" name="start">
<input value="stop" type="button" name="stop">
</form>
`
buttons.value = true
buttons.start.onclick = event => {
buttons.value = true;
event.preventDefault(); // Don’t submit the form.
buttons.dispatchEvent(new CustomEvent("input"));
}
buttons.stop.onclick = event => {
buttons.value = false;
event.preventDefault(); // Don’t submit the form.
buttons.dispatchEvent(new CustomEvent("input"));
}
return buttons
}
Insert cell
md`### error with hypertext literal library (2019-12-24):

I haven't explored how to fix this.
`
Insert cell
// import {html} from "@observablehq/htl" //uncomment to break
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more