Lucas Veiga Lucas Veiga - 9 months ago 115
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?