0

I'm editing my post, which is a duplicate of this issue here : How to hide link information at the bottom left/right of the browser on hover

I have this code from that post :

var aTags = document.querySelectorAll('span[data-href]');

for(var i = 0; i < aTags.length; i++){
    var aTag = aTags[i];
    aTag.addEventListener('click', function(e){
        var ele = e.target;
        window.location.replace(ele.getAttribute('data-href'));
    });    
}
span[data-href]{
    cursor:pointer;
}
<span data-href="http://www.google.com">test</span>

I have tried to change that example which is on a span, to an anchor, and the results are only visual, when i click on my anchor it doesn't start any exernal link, i've tried also an JS alert.

Am i missing something ?

alioua walid
  • 247
  • 3
  • 19

0 Answers0