Using CSS visited property for href to a file

Could you try to insert the URL directly in Browser History.

You can do something like:

HTML:

$(".file-link").click( function () {
  $(this).attr("href");
  var stateObj = { foo: "bar" };
  window.history.pushState({ title: "Services" }, "foobar.csv", $(this).attr("href"));
}); 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<a href="#/files/foobar.csv" class="file-link">
    http://example.com/files/foobar.csv
</a>
<a href="http://google.com">
    Google
</a>

Nice answer is also listed here: text-decoration not working for visited state link

You can done with this jquery addClass.

Demo code

$('a').click(function(){
    $(this).addClass('visited');
});

CSS

.visited {
  color: green;
  text-decoration: line-through;
}

fiddle demo: https://jsfiddle.net/nikhilvkd/7y2fyytw/

Tags:

Html

Css