jQuery not working in zen theme Ive put this code before the closing head tag in my html.tpl.php but nothing is happening. Im using the zen theme. Ive tried clearing my cache. 

Im I somehow missing a syntax error or is this a Zen/ Drupal qwerk? 

&lt;script&gt;
    $(document).ready(function() {
        alert('hi');
    });
&lt;/script&gt;

&lt;/head&gt;
It would be helpful to know what version of drupal you are using.

Modifying html.tpl.php to add Javascript like this is really a bad choice as it is a very brittle way of coding something.

Jquery in Drupal 7 is loaded using the noConflict mechanism. This avoids javascript namespace collisions:


  Many JavaScript libraries use $ as a function or variable name, just
  as jQuery does. In jQuery's case, $ is just an alias for jQuery, so
  all functionality is available without using $. If we need to use
  another JavaScript library alongside jQuery, we can return control of
  $ back to the other library with a call to $.noConflict():


If you wanted to use code like you've written you would write:

&lt;script&gt;
    jQuery(document).ready(function() {
        alert('hi');
    });
&lt;/script&gt;


You're better off adding a scripts[] entry into your theme_name.info file and placing such code in its own javascript file in your theme directory. Drupal will load it into the HTML &lt;head&gt; for you and aggregate your javascript files for you if you have aggregation turned on.

# In YOURTHEME.info
scripts[]= js/example.js

/* Example /sites/all/themes/YOURTHEME/js/example.js */
jQuery(document).ready(function($) {
  $('nav ul.primary-menu').append('&lt;div class="nav-blackhole"&gt;&lt;/div&gt;');
});