Having a hard time to grab a title from a list, here is my code.
<ul class="selected connected-list ui-sortable" style="height: 170px;">
<li class="ui-helper-hidden-accessible" style=""/>
<li class="ui-state-default ui-element" title="80 Days" style="display: list-item;"><span class="ui-icon ui-icon-arrowthick-2-n-s"/>80 Days<a class="action" href="#"></a>
</li>
</ul>
The first list item will not have a tile so it will always be the second list item.
$("ul.selected").closest("li").attr("title");
But getting no result. Hope you can advise !!
Thank you in advance if you can
closest doesn’t work because it searches in the the element itself and it’s parents, and you need to search inside it’s childrens.
eq matches a single element by its index, and is zero based.