javascript - view icon(ex. eye icon ) on click of a link -


i want display eye icon after click on link. eg. have job listings , saw 1 post , clicked view details after should show icon tells me visited post , have store viewed posts in collection , retrieve. have tried show eye icon on click when refresh page it's not displaying. how fix it? can me out that. in advance.

here sample html 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();     });   }); 

your question has not simple jquery answer. javascript variables or changes javascript in dom (html) not stored. need way store items can done multiple ways

  1. in cookie
  2. in localstorage
  3. in database on server (i prefer this) in case need ajax

and need receive these values on load of website , show icon on each item stored in cookie/localstorage/database (your choice)

i hope :)


Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -