JavaScript Create a folding navigation menu

Source: Internet
Author: User
Menus | creating

<script language= "JavaScript" >

<!--Begin

function Formhandler ()

{

var URL = document.form.site.options

[Document.form.site.selectedindex].value;

Window.location.href = URL;

End-->

}

</SCRIPT>


So how do you call it on the Web? Here is the specific code:

<CENTER>

<form name = "FORM" >

<select name= "Site" size=1 onChange = "Formhandler ()" >

<option value= "" > Connected to ....

<option value= "http://www.pconline.com.cn" > Pacific Internet

<option value= "http://cn.yahoo.com" > Chinese yahoo

<option value= "http://www.263.net" > 263 website

<option value= "http://www.usnews.com" > AOL

<option value= "http://www.neworiental.org" > Beijing New Oriental

</SELECT>

</FORM>

</CENTER>

Here's all the code:

<title> Untitled Document</title>

<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">

<script language= "JavaScript" >

<!--Begin

function Formhandler ()

{

var URL = document.form.site.options

[Document.form.site.selectedindex].value;

Window.location.href = URL;

End-->

}

</SCRIPT>

<form name = "FORM" >

<select name= "Site" size=1 onChange = "Formhandler ()" >

<option value= "" > Connected to ... </option>

<option value= "http://www.pcedu.com.cn" > Pacific Network College </option>

<option value= "http://cn.yahoo.com" > Chinese yahoo </option>

<option value= "http://www.263.net" > 263 website </option>

<option value= "http://www.usnews.com" > USA online </option>

<option value= "http://www.neworiental.org" > Beijing New Oriental </option>

</SELECT>
</FORM>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.