How to count <li> in <ul> with vanilla javascript
source link: https://kriss.io/how-to-count-li-in-ul-with-vanilla-javascript
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
- with vanilla javascript
I have found long list on Github Readme and want to count all of li tag that on ul tag by start google search found on Stackoverflow
but so many ul in page how that we get right ul tag
the answer is fairy simple too
with using chrome devtools add id
next use chrome devtools console access element by get id then get tag
document.getElementById("list").getElementsByTagName("li");
here simple result screenshot:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK