set a html option selected in a dropdown conatining optgroup tag using javascript : I'm working With Html(JSP) and Javascript. I have a dropdown box with id "examcenter" containing many optgroup as shown in the following code. in the function loadDrivingSchool() in javascript, I would like to set selected the value of the selected element. the loadDrivingSchool() function calls a controller in a server and when I return the view, the dropdown list does not have a selected value. I want to set this selected value to the value that the user choose before the reloading of the page
<select id="examcenter" onchange="loadDrivingSchool();">
						<option value="0">All</option>
						 
							<optgroup label="ADAMAOUA">
		                         	<option value="1">TIBATI</option>
		                         	<option value="2">TIGNERE</option>
		                         	<option value="3">MEIGANGA</option>
		                         	<option value="4">BANYO</option>
		                         	<option value="5">NGAOUNDERE</option>
						    </optgroup>
						 
							<optgroup label="CENTRE">
		                         	<option value="6">YAOUNDE</option>
		                         	<option value="7">ESEKA</option>
		                         	<option value="8">AKONOLINGA</option>
		                         	<option value="9">NANGA EBOKO</option>
		                         	<option value="10">MONATELE</option>
		                         	<option value="11">MBALMAYO</option>
		                         	<option value="12">MFOU</option>
		                         	<option value="13">NGOUMOU</option>
		                         	<option value="14">BAFIA</option>
		                         	<option value="15">NTUI</option>
						    </optgroup>
							<optgroup label="EXTREME NORD">
		                         	<option value="20">MAROUA</option>
		                         	<option value="21">KAELE</option>
		                         	<option value="22">KOUSSERI</option>
		                         	<option value="23">MORA</option>
		                         	<option value="24">YAGOUA</option>
		                         	<option value="25">MOKOLO</option>
						    </optgroup>
						 
							<optgroup label="EST">
		                         	<option value="16">YOKADOUMA</option>
		                         	<option value="17">ABONG-MBANG</option>
		                         	<option value="18">BATOURI</option>
		                         	<option value="19">BERTOUA</option>
		                         	<option value="62">NGUELEMENDOUKA</option>
							   
						    </optgroup>
						
					</select>