header selector in jQuery with example

Header selector returns all the header elements on the page such as h3, h3, h5 etc.

Example :

    <title>header Selector</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"> </script>
    <script type="text/javascript">
    <h3>This is h3 element.</h3>
    <p>This is paragraph element.</p>
    <div>This is div element.</div>
    <span>This is span element.</span><br/>
    <button id="myButton">Click Me</button>
    <button onclick="location.reload()">Reset</button>

Demo :

 In the above example, we have used header selector. Header selector selects header elements on the page. In the above example, the selector selects the h3 element and applies CSS to it.


Post a Comment