<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Test</title>
<style>
.item{
width:100px;
height:40px;
border:1px solid #333;
}
.item_sel{
width:100px;
height:40px;
background-color:#09F;
border:1px solid #03C;
}
</style>
<script>
function change(n){
document.getElementById("s1").className = 'item';
document.getElementById("s2").className = 'item';
document.getElementById("s"+n).className = 'item_sel';
document.getElementById("d1").style.display = "none";
document.getElementById("d2").style.display = "none";
document.getElementById("d"+n).style.display = "";
}
</script>
</head>
<body>
<span class="item_sel" id="s1" onClick="change(1)">国内</span><span class="item" id="s2" onClick="change(2)">国外</span>
<div id="d1">
<select>
<option>广州</option>
<option>北京</option>
<option>上海</option>
</select>
</div>
<div id="d2" style="display:none">
<select>
<option>纽约</option>
<option>伦敦</option>
<option>墨尔本</option>
</select>
</div>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Test</title>
<style>
.item{
width:100px;
height:40px;
border:1px solid #333;
}
.item_sel{
width:100px;
height:40px;
background-color:#09F;
border:1px solid #03C;
}
</style>
<script>
function change(n){
document.getElementById("s1").className = 'item';
document.getElementById("s2").className = 'item';
document.getElementById("s"+n).className = 'item_sel';
document.getElementById("d1").style.display = "none";
document.getElementById("d2").style.display = "none";
document.getElementById("d"+n).style.display = "";
}
</script>
</head>
<body>
<span class="item_sel" id="s1" onClick="change(1)">国内</span><span class="item" id="s2" onClick="change(2)">国外</span>
<div id="d1">
<select>
<option>广州</option>
<option>北京</option>
<option>上海</option>
</select>
</div>
<div id="d2" style="display:none">
<select>
<option>纽约</option>
<option>伦敦</option>
<option>墨尔本</option>
</select>
</div>
</body>
</html>
如果只要地级市,js文件其实很小。http://www.entiweb.com/share.htm请不要删除js文件中的版权申明