jQuery Filtering
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> </head> <body> <ul> <li>Item one</li> <li>Item two</li> <li>Item three</li> <li>Item four</li> </ul> <script> $(document).ready(function() { // Style the first and last list items $("li").first().css("font-weight", "bold"); $("li").last().css("color", "crimson"); // Style the third list item (index 2) $("li").eq(2).css("background", "#f5f5f5"); }); </script> </body> </html>