first-child Selector- jQuery
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html> <head> <title>first-child Selector- jQuery Example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $("#demo").click(function(){ $("ol li:first").css("border","4px solid red"); $("ol li:first").css("color","blue"); $("ol li:first").css("font-size","26px"); }); }); </script> </head> <body> <a href="javascript:void(0)" id="demo"> Click Me </a> <ol> <li> First Item </li> <li> Second Item </li> <li> Third Item </li> </ol> </body> </html>
<!DOCTYPE html> <html> <head> <title>first-child Selector- jQuery Example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $("#demo").click(function(){ $("ol li:first").css("border","4px solid red"); $("ol li:first").css("color","blue"); $("ol li:first").css("font-size","26px"); }); }); </script> </head> <body> <a href="javascript:void(0)" id="demo"> Click Me </a> <ol> <li> First Item </li> <li> Second Item </li> <li> Third Item </li> </ol> </body> </html>
Copyrights@tutorialsplane.com