How to change CSS using jQuery
In this article, we will explain to you how to change CSS using jQuery. so we will give you a simple example of how to change CSS using jQuery.
Example: jQuery css() Method
In this example, we use the jQuery css() method to change the font color of the specific element. so you can follow the below example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | <!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("p").css("color","green"); }); }); </script> </head> <body> <p style="color:red">Change font color using css() method</p> <button>Change the Font color</button> </body> </html> |
Please follow and like us: