Consider the following HTML:
You could also use Array.sort in jQuery, as explained here then use $('.a:last') to get the selected element.