Difference between :last and :last-child selector in jQuery / :last Vs :last-child selector in jQuery
:last Selector – Meaning and Usage :last selector fetches the last element from the collection of elements matched using a selector. Example, $(“span”) will select all span elements on the page. Adding the :last selector to the $(“span”) will return the last span out of those. If :last selector is used with another selector then, first the elements matching that selector are retrieved and then out of selected elements, those elements which are last in this list is returned. Example, $(“span.source:last”) will first retrieve those span elements which have the class source and then out of this collection, the last span is returned. :last-child selectorRead More →