How to use .class Selector Method in JQuery

This article describe about .class Selector Method in JQuery.
  • 1720

Use (.class) Selector method in jQuery

The .class selector method is selects specific class HTML element in jQuery.

Class is the process to refers all elements in HTML.

This is use to set a particular style for an HTML elements.


<!DOCTYPE html>



<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">

    $(document).ready(function () {

        $(".classname").css("background-color", "Yellow");





<h1>This is JQuery</h1>

<p class="classname">Use .class Selector</p>

<p>I am Aman</p>

<p>Hello World</p>

Who is your favorite:

<ul id="choose">

<li>My Self</li>

<li>My Friends</li>






You may also want to read these related articles here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.