jQuery - next()

The next() returns the next sibling element of the selected element.

  • list item 1
  • list item 2
  • list item 3
  • list item 4
  • list item 5

$("#btnDemo").click(function ()
{
    $( "li.third-item" ).next().css( "background-color", "red" );
});