Re: [dom] Proposal to improve the DOM creation api (#150)

So I stumbled upon [tagged template strings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings#Tagged_template_strings), which makes it seem that template strings and E4H can live in harmony. It would seem that you could remove (deprecate, etc.) the `innerHTML` function that takes a string and instead strictly use an HTML tagged function. The function can now understand the insertion points of the template string and can do E4H style processing to return safe DOM. This tagged function could also be used to just generate dom by itself.

This would be the new API to creating DOM that would satisfy my uses cases. 

```
var text = "foo";

// `html` is the tagged template function that runs E4H

// create a single node with attributes
document.body.appendChild( html`<div class="bar">${text}</div>' );

// create a series of sibling nodes
var element = html`<div>${text}</div><div>bar</div>`;
```

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/150#issuecomment-181640155

Received on Tuesday, 9 February 2016 00:31:36 UTC