To find the immediate next element from the element found by the selector, next()
method can be used.
<script>
$("div li").first().next().css("border", "5px dashed green");
</script>
Above code snippet will find the second “li” element under each “div” element (.first() method will find the 1st li element and .next() method will jump to the next matched element).
Views: 10912 | Post Order: 47