$("*").not() problem?

$("*").not() problem?

It seems that the .not() function isn't working if the '*' selector is used: this example code should display the last h4 element in black, but it isn't.

I haven't found any documentation yet that describes this behaviour...

  1. <!DOCTYPE html>
  2. <html>

  3. <head>

  4.    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
  5.    <script>
  6.    $(document).ready(function(){
  7.      $("*").not("#mytag").css("color","red");
  8.    });
  9.    </script>

  10. </head>

  11. <body>    

  12.    <h2>Lorem in red</h2>

  13.    <h4>Ipsum in red</h4>

  14.    <h2>Lorem in red</h2>

  15.    <h4 id="mytag">why is this text red??</h4>

  16. </body>

  17. </html>