Function to disable “href” anchor tags that contain “a data-name” on mobile only

Alright figured it out.

As Jacob pointed out, it should go into the script that makes data-name show as a tooltip.

So I added the following:

        if (jQuery(window).width() < 480) {
        jQuery(this).removeAttr("href");
        }

My final code:

jQuery(document).on({
    mouseenter: function(e) {
        if (jQuery(window).width() < 480) {
        jQuery(this).removeAttr("href");
        }
        setTimeoutConst = setTimeout(function() {
            tooltip.open(e);
        }, 200);
    },
    mouseleave: function(e) {
        clearTimeout(setTimeoutConst);
        tooltip.close(e);
    }
}, 'a[data-name]');