112
rated 0 times
[
115]
[
3]
/ answers: 1 / hits: 24172
/ 7 Years ago, mon, june 5, 2017, 12:00:00
Assume I have html structure as
ul
li //this one
ul
li
li
li
li //this one
I don't want to get all li
's.
As I commented I just want to get first segment li's. How can I select them?
document.querySelectorAll(ul > li);
returns all li
's.
edit: actually this is just a snippet of the tree.
I can't modify the structure as adding class or id. I'm looking for an answer to get the list of first layer li
s
More From » html