Published
Edited
Sep 19, 2019
Insert cell
md`# Encapsulando um input`
Insert cell
Insert cell
viewof a = html`<input type=checkbox checked />`
Insert cell
a
Insert cell
md`O Checkbox abaixo _nao_ funciona como esperado pois esta dentro de um div `
Insert cell
viewof b = html`<div><input type=checkbox checked /> b </div>`
Insert cell
b
Insert cell
Insert cell
viewof c = {
let input = html`<input type=checkbox checked />`;
let div = html`<div> ${input} c </div>`;
div.value = input.checked;
input.oninput = () => {
div.value = input.checked;
div.dispatchEvent(new CustomEvent('input'))
}
return div;
}
Insert cell
c
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