Другой вариант - Локальное хранилище HTML 5 .Я считаю, что это поддерживается в IE 8+ и во всех других основных браузерах.Вот пример того, как вы это сделаете:
//Runs once the DOM is ready
$(function() {
//Store the check box element in a variable
var checkbox = $("#elementID");
//The change event gets triggered every time the check box element is clicked
checkbox.change(function() {
//Set the checkbox value in local storage
localStorage.setItem("checkboxValue", checkbox.prop("checked"));
});
var checkValue = localStorage.getItem("checkboxValue");
//Since localStorage returns a string, you must catch it
//and then check or uncheck the box
if(checkValue === "true") {
//Check the box
checkbox.prop("checked", true)
}
else {
//Uncheck the box
checkbox.prop("checked", false)
}
});