Short answer: Cookies.
Long answer: I suggest you dont try it unless it is really important. Cookies are quite complicated. However, assuming you only want to store one value, it could be simplified.
Heres two nice functions for setting and reading cookies from Quirksmode, if you must:
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}
Then you could do something like:
<script type="text/javascript">
function change(id){
ID = document.getElementById(id);
if(ID.style.display == "")
ID.style.display = "none";
else
ID.style.display = "";
createCookie("id",id,7); /* 1 week */
}
window.onload = function() {
try{change(readCookie("id"));}catch(e){} //rough example
};
</script>
<div onclick="change(5)" style="cursor: hand">
<a href = "#">+</a>News
</div>
<div style="display: none" id="5">
News1<br/>
News2<br/>
</div>