Redirects with a Drop Down Menu

Submitted by:Pitter Alderson

Date added:04 July, 2012

Category:JavaScript

The JavaScript is just a function called redirect, and is requesting that a variable be passed to it.

Tags: redirects drop down menu

Code Snippet:

<script language="JavaScript" type="text/javascript">  
function redirect(site){
window.location= site
}
</script>

<select onchange="redirect(this.value)">
<option value="#">Where would you like to go?</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.ask.com">Ask</option>
</select>
 
 

Comments