I use this JQuery-Selector:
$("#foo > .row")
PHPStrom shows me Inefficient jquery selector.
Whats the more efficient way to select only direct childs of one ID?
I use this JQuery-Selector:
$("#foo > .row")
PHPStrom shows me Inefficient jquery selector.
Whats the more efficient way to select only direct childs of one ID?
Select the element by id, then get it's children.
$("#foo").children()
This is more efficient because it first uses document.getElementById
, then it gets the element's childNodes that are elements, skipping the selector engine completely.