Lucas Veiga Lucas Veiga - 10 months ago 121
Javascript Question

jQuery: Checking if next element exists

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) {
else {
alert("Dont exists");

What im doing wrong? Thanks a lot!


Have you tried looking at .next('li').length?