classclass selector in jQuery with exmaple

  1. classclass selector returns all the element with the specified class names.
  2. Using this selector we can select elements with more than one class applied.

Example 1 :

    <title>Multiple Class Selector</title>
    <script type="text/javascript" src=""> </script>
    <script type="text/javascript">
    <div class="myDiv1 myDiv2">This is div.</div>
    <button id="myButton">Click Me</button>
    <button onclick="location.reload()">Reset</button>

Demo :

In the above example, we have used classclass selector. ClassClass selector selects all the elements with the specified class names. In above example, it selects the div with the specifies two class names and applies CSS to it.


Post a Comment