-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJS.js
36 lines (35 loc) · 1.07 KB
/
JS.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
var parts=function()
{
var sel2=document.getElementById("sel2");
sel2.options.length=1;
var j;
var sldprovince=document.getElementById('sel1');
for (j=1;j<=cities.length;j++)
{
if (cities[j].province==sldprovince.value && cities[j].part!=cities[j-1].part)
{
var option=document.createElement("option");
option.text=cities[j].part;
sel2.appendChild(option);
}
}
}
var names=function()
{
var sel2=document.getElementById('sel2');
var sel1=document.getElementById('sel1');
var ul=document.getElementById('name');
ul.innerHTML='';
var j;
for (j=1;j<=cities.length;j++)
{
if (sel2.value==cities[j].part && sel1.value==cities[j].province)
{
var fname= cities[j].prefix+" "+cities[j].fname +" "+ cities[j].lname+"-"+cities[j].code;
var list=document.createElement('LI');
var text=document.createTextNode(fname);
list.appendChild(text);
ul.appendChild(list);
}
}
}