Re: [whatwg] Proposal: Adding methods like getElementById and getElementsByTagName to DocumentFragments

Eventually ES6 template strings [1] will make this awesome, as you'll do

querySelector(css`\n`)

or

querySelector(css`[data-some-id=${myId}]`)

or even

qs`[data-some-id=${myId}]`

But someone has to write these functions (css and/or qs) and there's no point in creating standard versions until template strings are actually in browsers. (Well, modulo transpilers.) In the meantime a CSS escaper function would be great and could be used to much more easily prolyfill such template string functions, or be useful independently. So, uh, +1 to that idea.

[1]: http://www.slideshare.net/domenicdenicola/es6-the-awesome-parts/23

Received on Thursday, 10 October 2013 00:50:33 UTC