0 votes
in JQuery by
What is the use of the css() method in JQuery?

1 Answer

0 votes
by
css() sets style properties for all the selected elements. It also returns the first matched element of the specified CSS property.

<p>Welcome to styling</p>

<p>I will be styled just as the previous paragraph</p>

<button>click me to change the style</button>

<script>

$(document).ready(function(){

$("button").click(function(){

$("p").css("color", "blue");

});

});

</script>

Related questions

0 votes
asked Nov 19, 2020 in JQuery by rajeshsharma
0 votes
asked Nov 17, 2020 in JQuery by rajeshsharma
...