I think creating nodes in javascript is a nogo, keep your html in your templates and just read the templates from js and there you can refer to nodes to do whatever you want in js.
But as always there are exceptions to the rule, and then this lib may come in handy.