F.eks. sådan:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<title>Vis/skjul menu -- og husk det !-)</title>
<script type="text/javascript" language="JavaScript">
function showMnu(id) {//IE4+, NS6+, alle browsere efter 1998
var menu = getElm("u"+id);
for(i=1;4>i;i++){
if(menu!=getElm("umenu"+i))getElm("umenu"+i).style.display='none';
}
if(menu.style.display=='none'){
menu.style.display='block';
document.cookie = "menu="+id;
}else{
menu.style.display='none';
document.cookie = "menu="+id;
}
}
function getElm(elm){
if(document.getElementById){
menu = document.getElementById(elm);
}else if(document.all){
menu = document.all[elm];
}
return menu;
}
function readCook(){
if(document.cookie){
cook = document.cookie;
mCook = cook.substring(cook.indexOf("menu=")+5);
if(mCook.indexOf(";"))
mCook = mCook.substring(0,mCook.indexOf(";"))
if(mCook.length==5)showMnu(mCook);
}
}
</script>
</head>
<body onload="readCook()">
<div id="menu1" style="cursor:pointer" onclick="showMnu(this.id);"><b>Velkommen</b></div>
<div style="display:none;" id="umenu1">
<a href="/min_mappe/" onFocus="this.blur()">Link 1</a><br>
<a href="/min_mappe1/" onFocus="this.blur()">Link 2</a><br>
</div>
<div id="menu2" style="cursor:pointer" onclick="showMnu(this.id);"><b>Velkommen</b></div>
<div style="display:none;" id="umenu2">
<a href="/min_mappe/" onFocus="this.blur()">Link 1</a><br>
<a href="/min_mappe1/" onFocus="this.blur()">Link 2</a><br>
</div>
<div id="menu3" style="cursor:pointer" onclick="showMnu(this.id);"><b>Velkommen</b></div>
<div style="display:none;" id="umenu3">
<a href="/min_mappe/" onFocus="this.blur()">Link 1</a><br>
<a href="/min_mappe1/" onFocus="this.blur()">Link 2</a><br>
</div>
</body>
</html>