I am changing image on click, the code for that is below, but when I reload the browser it resets the src
to default. I would like to retain the image src
even after page reload. How can I do that?
<img src="unmark.png" onclick="changeImage()" id="alert_img">
function changeImage() {
var image = document.getElementById('alert_img');
if (image.src.match("unmark")){
image.src = "mark.png";
} else {
image.src = "unmark.png";
}
};