How to hide visited links after a click to button?

前端 未结 2 924
醉酒成梦
醉酒成梦 2020-12-11 11:11

There are a list of links on a page and some of them are already visited by me. I have to make them invisible after any action(checking a checkbox, clicking button, etc).

相关标签:
2条回答
  • 2020-12-11 11:37

    You can try full CSS method :

    a:visited { display: none; }
    

    Or

    a:visited { visibility: hidden; }
    

    Or you can use a plugin method : Visited Plugin by Remy Sharp

    Usage in jQuery :

    $('a').visited().addClass('visited');
    

    With CSS :

    .visited { display: none; }
    

    Or

    .visited { visibility: hidden; }
    
    0 讨论(0)
  • 2020-12-11 11:41

    ok, so try this

    in your css file

    .foo a:visited{
        display:none;
    }
    

    in your javascript

    $('button').on('click', function(e){
        $('ul').addClass('foo');
    })
    
    0 讨论(0)
提交回复
热议问题