Skip to content

Instantly share code, notes, and snippets.

@marcellopato
Forked from anonymous/idade.js
Created June 28, 2016 18:32
Show Gist options
  • Save marcellopato/86fd4eac9559bd6511512238d175b6d5 to your computer and use it in GitHub Desktop.
Save marcellopato/86fd4eac9559bd6511512238d175b6d5 to your computer and use it in GitHub Desktop.
function addIdade(idade) {
var key = 'clickcount_'+idade;
if (sessionStorage.getItem(key)) {
sessionStorage.setItem(key, Number(sessionStorage.getItem(key)) + 1);
} else {
sessionStorage.setItem(key, 1);
}
document.getElementById("idade"+idade).innerHTML = sessionStorage.getItem(key);
sessionStorage.removeItem("conforto");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment