Prev Demo
jQuery
>
.Addclass() - Add Class To Element
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <style> div { color: Pink; background-color: skyblue; font-family: arial; } </style> </head> <body> <p class="class">www.kidsfunda.com is for KIDS</p> <p class="class1">www.dotnetfunda.com is for DOTNET tutorials</p> <div class="class2">www.techfunda.com is for all type of technologies</div> <p class="class3"> TechFunda Gives the best quality of tutorials.</p> <script language="javascript" type="text/javascript"> $("div").addClass("class2"); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output