JavaScript case six: Simple provincial linkage (nba Edition)

Source: Internet
Author: User

JavaScript for simple provinces and cities (nba Edition) linkage

<!DOCTYPE HTML><HTML>  <Head>    <title>JavaScript for simple provinces and cities (nba Edition) linkage</title>    <Metahttp-equiv= "content-type"content= "text/html; charset=utf-8">    <Scripttype= "text/javascript" >        vararr=NewArray (3); arr[0]=["Knights","James","Owen","Loafers","TT"]; arr[1]=["Warriors","in the library","Durant","Thompson","Green"]; arr[2]=["Spurs","Duncan","Gino , Billy.","Parker","Card Wow","Aldridge"]; functionChoose (value) {vars=document.getElementById ("S1"); vara=S.getelementsbytagname ("option");  for(vark=0; k<a.length;k++)//when choosing a new team, you should remove the players from the previous team{s.removechild (a[k]); K--; //the array is changing dynamically!             }             for(varI=0; I<Arr.length;i++)            {                varTemp=arr[i]; if(value==temp[0])                {                     for(varJ=1; J<temp.length;j++)                    {                        varop=Document.createelement ("option"); varte=document.createTextNode (temp[j]);                        Op.appendchild (te);                    S.appendchild (op); }                }            }        }    </Script>  </Head>  <Body>      <Selectonchange= "choose (this.value)">          <option>---please select---</option>          <optionvalue= "knight">Knight</option>          <optionvalue= "warrior">Warrior</option>          <optionvalue= "spurs">Spurs</option>      </Select>      <SelectID= "s1"></Select>  </Body></HTML>

Operation Schematic:

JavaScript case six: Simple provincial linkage (nba Edition)

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.