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)