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.
<!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>