As stated above, you need to check the length of the element. Jquery.next () will always return a jquery object, but if there is no next element, it will have a length of 0.
if($("#people .making-of .mask ul li.current").next("li").length > 0) { alert("Exists"); } else { alert("Dont exists"); }
mattgmg1990 06 Oct '11 at 18:07 2011-10-06 18:07
source share