What is the best practice to print html in javascript without using "framework" like handlebarsjs, etc. ?

Something like:

```
var template = "<div>test test </div>";
$( '#div' ).html(template);

```

Thanks