I want to check the li that is the last li in ul. How can I check that using jQuery?
li
ul
Just use the :last-child selector :
$('#ulscroller li:last-child')
DEMO: http://jsfiddle.net/f5v6R/
For example, if you want to know if it has the selected class you may do
selected
if ($('#ulscroller li:last-child').hasClass('selected')) { // do something }