Please find the code which i used. Please tell me how to retain the selected dropdown when we press back in the browser...

<style type="text/css">
#navMenu {
margin: 70px;
padding: 40px;
#navMenu select {
color: #000;
background: #CD5C5C;
font-size: 15px;
font-weight: bold;
padding: 2px 10px;
width: 200px;
p.hiddenMenu {
display: none;
p.visibleMenu {
display: inline;

<script type="text/javascript">
var lastDiv = "";
function showDiv(divName)
if (lastDiv)
document.getElementById(lastDiv).className = "hiddenMenu";
if (divName && document.getElementById(divName))
document.getElementById(divName).className = "visibleMenu";
lastDiv = divName;


<body bgcolor="#87CEFA">
<div id="wrapper">
<div id="navMenu">
<select name="category" id="statename" onchange= "showDiv(this.value);">
<option value="-1"><b>--Select State--</b></option>
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
<option value="four">four</option>
<br class="clearFloat" /></br>

<form id="aform">
<p id="one" class="hiddenMenu">
<select id="mymenu" size="1" onchange="[this.selectedIndex].value,'_parent')" >
<option value="">--select--</option>
<option value="">one selected</option>
<option value="">two selected</option>