Prev Demo
jQuery
>
.Next() - Immediate Next Element
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <div> <li>APPLE</li> <li>BANANA</li> <li>CAR</li> <li>DOLL</li> <li>Eagle</li> </div> <br/> <br/> <script> $("div li").first().next().css("border", "5px dashed green"); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output