I’ve a list as
<ul id="list">
<li id="one"></li>
<li id="two"></li>
<li id="three"></li>
.....
....
....
</ul>
I want to get the ids of every li element inside the ul#list. Since the number of li item is unknown, I would want to go through a loop for as long as an li item exist. Something like
while($('#list li') exists){
//Get id of the element
}
Can anyone help me with this?
try: