4 ms·
Neat idea, but you're going to have to refactor many lines of code each time you wrap elements in a new parent element. In other words, this is a ball & chain f
by magoon 13y ago
Neat idea, but you're going to have to refactor many lines of code each time you wrap elements in a new parent element. In other words, this is a ball & chain for
your markup.
- grey-area 13y agoIn what way is this different from jquery? You can do this too: HTML.find('body section .identity') which is just like jquery's $('body section .identity') and both depend on the structure of your document, so if the doc changes, the code must change.
- magoon 13y agoI thought the whole point was to be able to access a DOM element hierarchy as an object hierarchy? My point is that this convenience comes at a cost, and so I would also not use jQuery in that way. Conservative targeting of selectors negates the very cool benefits of this library, at least for my use.
- janjongboom 13y agoWhich is just like `document.querySelectorAll('body section .identity')` which also works in IE8+, FF, Chrome.
- grey-area 13y agoI think it passes through to that with the find method, so yes, exactly like that. Whatever you use to query though, if you use CSS selectors, your code will be dependent on the structure of the HTML document. You can't really escape that if you're using the DOM, and I don't see why any of these methods is any different in that regard. So it's the same as jquery in that sense.