in my project i have menu and for smaller screen i use dropdown menu.here's html code for that.
<select>
<option value="index.php" id="home">Home</option>
<option value="about?aboutus=aboutus" id="about">About Us</option>
<option value="courses?cosoff=cosoff" id="courses">Courses Offered</option>
<option value="admission?admi=admi" id="admission">Admission</option>
<option value="facelities?face=face" id="facelities">Facelities</option>
<option value="events?eve=eve" id="events">Events</option>
<option value="career.php?car=car" id="career">Career</option>
<option value="contact.php?con=con" id="contact">Contact</option>
</select>
and i use jquery for selecting menu and stay them selected.and it is
<script type="text/javascript">
window.onload = function() {
$(document).ready(function() {
$("#about").children("option").is("selected").text()
});
}
</script>
this is just for id=about,like that for every id i had put jquery but it's not working for option value to set selected.and second problem is id=home is default selected then i go to for ex. id=about and then again i go to id=home it won't redirect to index.php
ready()inloadevent. Remove that and it should work#about.#aboutis the id of one of your options, not of your select field