Is there a way to check if an next element exists? Check my code:
if($(\"#people .making-of .mask ul li.current\").next(\"li\") != null) { alert(\"Exists
Use the length method in jQuery:
length
if($(...).next().length > 0) { alert("Exists.") } else { alert("Doesn't exist!") }