Public
Edited
Nov 10
Importers
11 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
async function sendMsg(evt) {
if (evt.keyCode === 13) {
console.log(msgs);
mutable msgs = msgs.concat([evt.target.value]);
}
}
return htl.html`
${msgs.map((msg) => htl.html`<p>${msg}</p>`)}
<input class="text" onkeydown=${sendMsg}></input>
<button onclick=${() => (mutable msgs = [])}>clear</button>
`;
}
Insert cell
Insert cell
Insert cell
{
function sendMsg(evt) {
if (evt.keyCode === 13) {
console.log(msgs);
mutable msgs = msgs.concat([evt.target.value]);
}
}
return reconcile(
this,
htl.html`
${msgs.map((msg) => htl.html`<p>${msg}</p>`)}
<input id="chat" class="text" onkeydown=${sendMsg}></input>
<button onclick=${() => (mutable msgs = [])}>clear</button>
`
);
}
Insert cell
Insert cell
Insert cell
morph = require('https://bundle.run/nanomorph@5.4.2')
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
NestedDOMUpdateInPlaceDOM = html`
<div id="NestedDOMUpdateInPlace"><p>
<b>raw</b>
</p></div>`
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