Check if a certain element exists anywhere in the DOM

Using jQuery to determine if there's any element with a certain class on the current page:

    // check if an element with class 'footable' exists, then call footable() on it
    if($('.footable')[0]) {
      $('.footable').footable();
    }

Source: http://stackoverflow.com/a/5783355/93261


Need a great new website or a helping hand with Drupal? Head over to www.klickreflex.de or contact me directly to see if we can work something out.