Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

jQuery | :header Selector

  • Last Updated : 12 Apr, 2019

The :header Selector is used to select all the heading elements that is from (<h1> to <h6>).

Syntax:

$(":header") 

Example: Change the color of all headings to green .




<!DOCTYPE html>
<html>
  
<head>
    <script src=
    </script>
    <script>
        $(document).ready(function() {
            $(":header").css(
                "color", "green");
        });
    </script>
</head>
  
<body>
    <center>
        <h1>GeeksForGeeks</h1>
        <h2>jQuery :header Selector
      </h2>
  
        <div style="color:orange;">
            GeeksForGeeks
        </div>
        <h5>A computer science 
          portal for geeks.
      </h5>
        <p style="color:dodgerblue">
            Sudo Placement
        </p>
        <p>GFG</p>
    </center>
</body>
  
</html>

Output :

Supported Browsers: The browser supported by jQuery :Header Selector are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari



My Personal Notes arrow_drop_up
Recommended Articles
Page :