maybe something like that:
include karax / prelude
var testText = kstring"..."
proc onChText(id: kstring): proc() =
result = proc() =
testText = getVNodeById(id).text
echo "onChText..."
proc createDom(): VNode =
echo "render
Please consider to use Karax for browser based developments.
[https://nim-lang.org/araq/karax.html](https://nim-lang.org/araq/karax.html)
Karax comes with a tool `karun`, that can produce the HTML boilerplate for you.
In my slow navigation of the nim learning curve, I had reason to use the
javascript output function for modifying contents of a web page. In short it
was a simple exercise to learn with. However there were some things that took
me a lot longer to figure out than I expected. So I over-commented