I haven't actually done it myself, but there seems to be two general approaches: generate the DOM "programmatically using [karax](https://github.com/pragmagic/karax) or just interfacing with the HTML DOM as you seem to be trying to do.
Using dom would seem to be pretty straightforward following what one would do in JavaScript: just [getElementById](https://nim-lang.org/docs/dom.html#getElementById%2Ccstring) which returns an [Element](https://github.com/nim-lang/Nim/tree/version-1-0/lib/js/dom.nim#L193), which contains a contentEditable as a cstring and if that was (say) a text element, I would say you could just set that to whatever you wanted to show. One if these days I'll get around to actually trying this, but I'm pretty sure something along this line will work.
