Drop down with redirect function

<!DOCTYPE html>
<html>
<body>
<h3 align="center">Where Do You Want to Go Today?</h3>
<center>
<form>
  <p><select name="section" size="1" language="javascript" onChange="gotoPage(this.selectedIndex);">
  <option selected>Where do you want to go today?</option>
  <option>Google</option>
  <option>Microsoft Home Page</option>
  <option>MSN Home Page</option>
  </select></p>
</form>
</center>
<script language="JavaScript">
<!--
function gotoPage(varItem)
{
  switch(varItem)
  {
    case 0:
      window.parent.self.status="Goes Nowhere";
      break;
    case 1:
     window.location="http://www.google.com";
      break;
    case 2:
      window.location="http://www.microsoft.com";
      break;
    case 3:
      window.location="http://www.msn.com";
      break;
  }
}
// -->
</script>
</body>

</html>

Comments

Popular posts from this blog

CS3150 Assignment 1

CS4500 Test 4 Study Guide

CS4150 Assignment 2