I would like to have number (int) of ul with class ‘currentWeek’. My html look like this:
<div class="calendarContainer">
<ul>
<li></li>
<li></li>
<li></li>
</ul>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
<ul class="currentWeek">
<li></li>
<li></li>
<li></li>
</ul>
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</div>
this is how I could all UL’s
var weeksCount = widget.find(".calendarContainer").children().length;
But I have no idea how to know that currentWeek is third
Many thanks!
How about this:
Quoting the .index doc:
You might want to add 1 to result, if you need to get the natural (not 0-based) number of that element.