lib/index.js
function getHrefRec(element) {
    var href = element.getAttribute('href');

    if (href) {
        return href.replace(location.origin, '');
    }

    if (element.parentElement && element.parentElement !== document.body) {
        return getHrefRec(element.parentElement);
    }

    return null;
}
function getHrefRec(element) {
    var href = element.getAttribute('href');

    if (href) {
        return href.replace(location.origin, '');
    }

    if (element.parentElement && element.parentElement !== document.body) {
        return getHrefRec(element.parentElement);
    }

    return null;
}
function getHrefRec ( element ) { var href = element . getAttribute ( 'href' ) ; if ( href ) { return href . replace ( location . origin , '' ) ; } if ( element . parentElement && element . parentElement !== document . body ) { return getHrefRec ( element . parentElement ) ; } return null ; }
Search recursively href attribute value between given element and parents
Search recursively href attribute value between given element and parents