Is there a way to check if a next element exists? Check my code:
if($("#people .making-of .mask ul li.current").next("li") != null) { alert("Exists"); } else { alert("Dont exists"); }
What am I doing wrong? Thanks a lot!
Advertisement
Answer
Have you tried looking at .next('li').length
?