I have a following page where I set default selected item in drop down list. I select a new value from select drop down list .After page refresh that value is selected but not the default selected.I am using Mozilla Firefox.This is not happening in chrome. What is the reason for this behavior in Firefox(version-35.0.1). I need to know why different things happening in chrome and in firefox.
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="container">
<form name="" action="auth.php" method ="post">
<div>
<table id="one-column-emphasis">
<tr>
<th>
Student Name:</th>
<td><input type="text" name="student_name" required>
</td>
</tr>
<tr>
<th>Mobile No/Email </th>
<td><input type="text" name="mobile" required>
</td>
</tr>
<tr>
<th>Examination:</th>
<td><select name="exam"id="exam"onchange="myFunction()" required>
<option value="hs"selected>HS</option>
<option value="cbse">CBSE</option>
<option value="icse">ICSE</option>
<option value="other">OTHER</option>
</select>
</td>
<td><input type="hidden" name="other_exam" id="other_exam"></td>
</tr>
<tr>
<th>Board:</th>
<td><select name="board" onchange="myFunction1()"id="board"required>
<option value="WBCHSE" selected>W.B.C.H.S.E</option>
<option value="cbse">C.B.S.E</option>
<option value="icse">I.C.S.E</option>
<option value="other">OTHER</option>
</select>
</td><td><input type="hidden" name="other_board" id="other_board"></td>
</tr>
<tr>
<th>Roll No</th>
<td><input type="text" name="roll"required>
</td>
</tr>
<tr>
<th>Year of Passing</th>
<td><select name="yop"required>
<option value="2013"selected>2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
</select>
</td>
</tr>
<tr>
<td >
<input type="reset" name="submit" value="Reset">
</td>
<td>
<input type="submit" name="submit" value="Next">
</td>
</tr>
</table>
</form>
</div>
<script>
function myFunction() {
var x = document.getElementById("exam").value;
if(x=="other")
document.getElementById("other_exam").type = "text";
else
document.getElementById("other_exam").type = "hidden";
}
function myFunction1() {
var x = document.getElementById("board").value;
if(x=="other")
document.getElementById("other_board").type = "text";
else
document.getElementById("other_board").type = "hidden";
}
</script>
</body>
</html>