Published
Edited
Feb 4, 2021
1 fork
15 stars
Insert cell
Insert cell
x
Insert cell
viewof x = html`<input type=range min=0 max=100 step=1>`
Insert cell
Insert cell
{
const form = html`<form onsubmit="return false;">
<button name=inc>increment</button>
<button name=dec>decrement</button>
</form>`;
form.inc.addEventListener("click", () => {
++viewof x.value;
viewof x.dispatchEvent(new CustomEvent("input"));
});
form.dec.addEventListener("click", () => {
--viewof x.value;
viewof x.dispatchEvent(new CustomEvent("input"));
});
return form;
}
Insert cell
Insert cell
{
const input = html`<input type=range min=0 max=100 step=1>`;
viewof x.addEventListener("input", () => {
input.value = viewof x.value;
});
input.addEventListener("input", () => {
viewof x.value = input.value;
viewof x.dispatchEvent(new CustomEvent("input"));
});
return input;
}
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