How to Create jQuery CSS() Method

In this article, you will learn How to Create jQuery CSS Method. CSS is a cascading stylesheet so we will explain How to Create jQuery CSS() Method.

Example:-

<html>
<head>
<title>jQuery css() Method</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("p").css({"background-color": "yellow", "font-size": "200%"});
  });
});
</script>
</head>
<body>
<p style="background-color:#ffb100">Welcome to </p>
<p style="background-color:#00ff00">Hub of Tutorials</p>
<p style="background-color:#ff0000">This is a New paragraph.</p>
<p>This is the paragraph.</p>
<button>click for multiple styles of p</button>
</body>
</html>

Read on Facebook

Leave A Reply