People I have a code that makes a link stay green for 10 seconds and then it turns blue, the only problem is that if I refresh the page within 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>