我需要存儲在臨時變量幾個元素,所以當我回到那個pahe我可以向他們展示在頁面加載如何存儲在HTML/jQuery的價值
我對8 li element
但讓我點擊5 li
,所以我要存儲5 li
ID某處
$("#divPopup").on("click", "li", function() {
...
var newId = $this.attr('Id').replace("Left", "Right")
// here i want to store newID, each time user click on event, it should be unique values , i want to store in $('#hdnValueProjectBtn').val(newId);
}
else {
var newId = $this.attr('Id').replace("Left", "Right")
$('#' + newId).hide();
}
});
使用cookie存儲臨時值。 – smartmeta 2013-03-05 17:55:15
Cookie或localStorage是您需要的。 – 2013-03-05 17:56:47
是的,但我不想使用cookie – 2013-03-05 17:57:29