Lucas Veiga Lucas Veiga - 2 years ago 334
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!

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download