- 1
jquery
Select all elements that are direct children of div elements. $("div > p") it is correct or not ??
2 ответов
+ 4
It's not, or the question is incomplete:
$('div > p')
... will select all <p> elements that are direct children of a <div>
To select all elements that are direct children of <div>, you must write:
$('div > *')
Anyway, this is less related to JQuery than to Css, as it use Css selectors ;P
0
why is it change to * because the information I got tells me that $("div>p")