I want to display an eye icon after click on a link. For eg. I have a job listings and I saw one post and clicked to view details after that it should show an icon that tells me that I visited the post already and I have to store the viewed posts in a collection and retrieve. I have tried to show an eye icon on click but when I refresh the page it's not displaying. How to fix it? Can anyone help me out with that. Thanks in advance.
Here is the sample HTML that I am trying
<div id="search"><h2><a href="#">Clinical Psychologist </a><span class="job-type part-time">Part Time</span></h2></div>
<div id="eyeIcon">
<span class="glyphicon glyphicon-eye-open"></span>
</div>
And JS
$(document).ready(function(){
$("#eyeIcon").hide();
$("#search").click(function(){
$("#eyeIcon").show();
});
});