function filters_checkboxes() { console.log("refresh filters"); fetch_list().then(function(data){ { const node = document.getElementById("filters_checkboxes"); while (node.firstChild) { node.removeChild(node.lastChild); } } const node = d3.select("#filters_checkboxes"); for (const itemlist of data) { var label = node.append("label"); var input = label.append("input") .attr("type", "checkbox") .attr("class", "checkbox-filters") .attr("id", `checkbox-${itemlist.uuid}`); label.append("span") .text(`${itemlist.name}`); node.append("br"); } }) }