Jquery change dropdownlist link

Jquery change dropdownlist link

I have a page that has a dropdownlist I was wondering how can i use jquery to navigate to the link each time a user selects an option on the dropdownlist onchange . i already have some code that works but for some reason this doesnt work on firefox but it works on internet explorer.
 

<script type="text/javascript">

function goToPage(url) {

if (url != "") {

navigate(url);

}

}

</

script >
 
 

 

<form action="" method="get" style="background-color:#FFFF99">

 

<select onchange="goToPage(this.options(this.selectedIndex).value)" style="width:300px">

 

 

 

<option value="/buyer/search">Buyers</option>

 

<option value="/renter/search">Renters</option>

 

 

</select>

</form>
 
 
 
 
 
 
 
 
 
as i said the above code works but it doesn't in firefox is there an alternative to this code or how i can make it work in firefox?