select = select || function (selector, root) {

    // Set root to given root or document
    root = root || doc;