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

Domenic Denicola domenic at domenicdenicola.com
Wed Oct 9 17:50:05 PDT 2013


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



More information about the whatwg mailing list