Skip to content

Instantly share code, notes, and snippets.

@paterson
Last active January 2, 2016 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paterson/8303396 to your computer and use it in GitHub Desktop.
Save paterson/8303396 to your computer and use it in GitHub Desktop.
function deleteCookies(array) {
var r = confirm("Are you sure you want to clear your score!");
if (r) {
for (var i = 0; i < array.length; i++) {
document.cookie = array[i] + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
}
alert("Your score has been cleared!");
}
else {
window.location="javascript:history.go(0)";
}
}
//Example
deleteCookies(['id3','correct3'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment