EDITABLE CODE:
LiveDemo:jQuery - first() and last() Method
Note: The script selects the first and last elements within the jQuery Object.