Class Selector jQuery Example
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html> <head> <title>jQuery $(this) 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(){ $("div.myclass").css("border","4px solid red"); $("p.myclass").css("background","yellow"); $("span.myclass").css("font-size","36px"); }); </script> </head> <body> <div class="myclass"> Div One.. </div> <br> <div> Div Two.. </div> <p class="myclass"> Paragraph.. </p> <span class="myclass"> Span... </span> </body> </html>
<!DOCTYPE html> <html> <head> <title>jQuery $(this) 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(){ $("div.myclass").css("border","4px solid red"); $("p.myclass").css("background","yellow"); $("span.myclass").css("font-size","36px"); }); </script> </head> <body> <div class="myclass"> Div One.. </div> <br> <div> Div Two.. </div> <p class="myclass"> Paragraph.. </p> <span class="myclass"> Span... </span> </body> </html>
Copyrights@tutorialsplane.com