Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <head> <script src="../../ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("ul + div").css("background-color","yellow"); }); </script> </head> <body> <ul> <li>List item</li> </ul> <div>This is a div element that is next to an ul element</div> <p>This is a paragraph (not a div)</p> <div>This is another div element (will not be selected)</div> <ul> <li>List item</li> </ul> <div>This is also a div element that is next to an ul element</div> <p>This is another paragraph (not a div)</p> <div>This is another div element (will not be selected)</div> </body> </html>
Result:
W3Schools.com - Try it yourself