I am trying to remove a particular class from all external urls on a page, only if a cookie has been set. I have the below code but doesn't work as expected.
jQuery(document).ready(function() {
  var vLink = jQuery('.external a');
    if (localStorage.getItem("cookiename")) {
        vLink.removeClass('myclass');
    }
});
 
    