In the firebug(any) console, try jQuery('#edit-title').css('color', 'red');
it should work or something with the css is wrong.
For Drupal you're really supposed to use something like this to do on document load:
(function ($) {
Drupal.behaviors.exampleModule = {
attach: function (context, settings) {
$('.example', context).click(function () {
$(this).next('ul').toggle('show');
});
}
};
})(jQuery);
Check out Managing JavaScript in Drupal 7, and search for "behaviors".
@ krister.. The code is a function where the $
variable is jQuery
. So in most languages you create function and declare variables that you want passed into it. Well in JavaScript you can create that in one line.
function some_function(tmpVar){ alert(tmpVar); }
some_function("Woot!");
You can wrap the function side in ()s and it still works
( some_function )("Woot!");
Now you can put an anonymous function block instead of some_function
( function(tmpVar){ alert(tmpVar); } )("Woot!");
and finally the jQuery
(function($){... the $ = jQuery ...})(jQuery);
jQuery
over the$
syntax. In other words,jQuery(document).ready(function() { jQuery('#edit-title')
and so on. – Cyclonecode Oct 18 '12 at 21:49