I want to iterate through a few HTML elements and get their values. I tried using $.each()
for this but I can't figure out how to do it when an element has other elements of variable types inside it. I have the HTML DOM structure as :
<li>
<div>X</div>
<br/>
<span>Category : </span>
<div>Y</div>
<span><br/>Rating</span>
<div>
<span>Z</span>
</div>
I want to retrieve the values X , Y , Z
from it. Also there are multiple instances of this so I will have to iterate through each of them. Can anyone suggest some approach to this?