Published
Edited
Oct 7, 2019
Insert cell
viewof mylist = {
const text = html`<input value = "arr_elem">`;
const reset_list = html`<input type="button" value="Reset list">`;
const trigger = html`<input type="button" value="Add value">`;
const div = html`${text}<br/>${trigger}${reset_list}`;

trigger.onclick = () => {
div.value.push(text.value);
div.dispatchEvent(new CustomEvent('input'));
};
reset_list.onclick = () => {
div.value = [];
div.dispatchEvent(new CustomEvent('input'));
};
div.value = [];
return div;
}
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