Public
Edited
Nov 12
Importers
2 stars
Insert cell
Insert cell
domView = ({ className = "" } = {}) => {
const dom = document.createElement("div");
dom.className = className;
dom.value = undefined;
invalidation.then(dom.addEventListener("input", () => {}));
Object.defineProperty(dom, "value", {
set: (value) => {
if (dom.firstChild) dom.textContent = "";
if (value) dom.appendChild(value);
},
get: () => dom.firstChild
});
return dom;
}
Insert cell
viewof example = domView()
Insert cell
(viewof example.value = html`<button>❤️</button>`)
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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