function dom2json() { const jsContainer = document.querySelector("#jsContainer") function domJson(dom) { var obj = { tag: getTagName(dom) } if (dom.nodeType == 1) { var attrs = ...