So I have:
<li id="foo">
<span> bar </span>
<ul>
<li>
<span id="1234"></span>
</li>
<li>
<span id="5678"></span>
</li>
</ul>
</li>
I need concatenate the span ids and make var foobar = “12345678”
P.S. I need start working from the top Li which has the id of “foo” since the span ids can be dynamic/unknown.
Thanks!
Try this: