Drupal.behaviors.myTheme = attach: function (context, settings) $('.button', context).on('click', function() ... );