retain dropdown selection on refresh

Possible Duplicate:
retaining selected dropdown option on postback

I have a dropdown when user selects the option, the value is passed on to the same url as querystring refreshing the page. after the page refreshes i wanna retain the selected value so user knows what was selected. How do i do this in jquery?

<select id="hospitalDropDown" onchange="[this.selectedIndex].value,'_top')"> 
        <option value="">All Hospitals</option>
  <option value="">Dyer</option>
  <option value="">Carmel</option>

Basically the logic is trap the selection in some variable and pass it as selected equals true but i am not being able to do it in jquery..I don't have acccess to server side code..either


For a clean method you can set a cookie

Take a look at the following question and the replies

jQuery cookies setting select drop down value after page refresh

*But my favorite is to set the selection in the user session using ajax method.

<select id="hospitalDropDown"> 
    <option value="">All Hospitals</option>
    <option value="Dyer">Dyer</option>
    <option value="Carmel">Carmel</option>
<script type="text/javascript">

$(document).ready(function() {
    $('#hospitalDropDown').val('<?php echo $_GET['hos']; ?>');
    $('#hospitalDropDown').change(function() {
        location.href = '' + $(this).val();


 ? retaining selected dropdown option on postback
 ? Populating a dropdown with jquery/json
 ? Select dropdown works differently
 ? stop list dropdown going off-screen
 ? stop list dropdown going off-screen
 ? stop list dropdown going off-screen
 ? Modal inside a dropdown list is not working
 ? Fixed bottom navbar dropup menu drops down into navbar on smaller screens
 ? Bootstrap Navbar Dropdown not always opening
 ? How do I show different options on dropdown?