Prev Demo
jQuery
>
Class Selector (“.Class”)
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE HTML> <html> <head> <title>Class Selector</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> </head> <body> <div> <p id="p1"> This is id selector. </p> <p class="class1"> This is Class selector. </p> </div> <script language="javascript" type="text/javascript"> $(".class1").css("border", "5px solid green"); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output