JQuery Selector header

From CoderLearner
Jump to: navigation, search

Description

Select header like h1, h2, h3, h4, and so on.

Syntax

$(':header')

Example 1

<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Select</title>
      <script 
         type="text/javascript" 
         src="/lib/jquery-1.7.2.min.js">				 
      </script>
      <style>


      </style>
      <script>
         $().ready(function() {
            $(':header').css('color','red');
         });
      </script>
   </head>
   <body> 
      <h2>List</h2>
      <ul>
         <li>One</li>
         <li>Two</li>
         <li>Three</li>
      </ul>
   </div>
   <h3>Group</h3>
   <p>Blue Vs. Red</p>
</body>
</html>

Try It