0
Guys I have a code that makes a link turn green for 10 seconds and then turns blue, the only problem is that if I update the page within those 10 seconds it comes back all over again. So I wanted to know how to make the action continue where it left off even after updating, see the code:
<a id="id1" href="https://br.answers.yahoo.com" onclick="myFunction(event)" target="_blank">Clique Aqui</a> <br/><br/>
<script language="javascript">
function myFunction(s) {
var id = s.target.id;
document.getElementById(id).style.color = "green";
setTimeout(function(){
document.getElementById(id).style.color = "blue";
}, 10000);
}
</script>
Good, you can always try using localStorage.
– Bruno