AJAX
Basics
Data
DOM
Effects
Events
Forms
jQuery UI
Plug Ins
Traversing
The last()
method grabs and returns the first element inside of the selected parent element.
This works well for element and class selectors since multiple matches can be found ....but not so well with
ID selectors alone. If you use an ID selector, be sure to use a Class or Element selector to target the first/last
element within.
For example:
$("#btnDemo").click(function ()
{
$("#example1 li").last().css({ "border-color": "red", "border-width": "3px", "border-style": "solid" });
});