Hi I want to add a click event to an element that hides another element. I have added a script using my theme's info file, the contents follow:
(function ($) {
Drupal.behaviors.showhide = {
attach: function (context, settings) {
$('p.seekerclick').click(function(){
$('div#block-views-exp-aid-search-for-seeker-page').hide();
});
}
};
})(jQuery);
I can verify with firebug that that script is being loaded, but the element does not show a click event and clicking on it does not hide the other element. What is wrong?
The click element is in a custom block and the hide element is in a view exposed as block. Is there a setting in Drupal to activate javascript? Is there a better place to add the script instead of from the theme info file? When I look at the page with firebug, should I see the "onclick" attribute added to the click element?