注:需要在服务器下执行才可以
版本一:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script src="jquery.min.js"></script>
<script src=" jquery.cxselect.js"></script>
<style>
</style>
</head>
<body>
<div id="citys">
<h1>国内城市三级联动</h1>
<select class="province" id=""></select>
<select class="city" id=""></select>
<select class="area" id=""></select>
</div>
</body>
<script>
$(document).ready(function(){
$('#citys').cxSelect({
'url':'cityData.json',
'selects':['province','city','area']
});
});
</script>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script src="jquery.min.js"></script>
<script src=" jquery.cxselect.js"></script>
<style>
</style>
</head>
<body>
<div id="citys">
<h1>国内城市三级联动</h1>
<select class="province" id=""></select>
<select class="city" id=""></select>
<select class="area" id=""></select>
</div>
</body>
<script>
$(document).ready(function(){
$('#citys').cxSelect({
'url':'cityData.json',
'selects':['province','city','area']
});
});
</script>
</html>
版本二:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script src="jquery.min.js"></script>
<script src="jquery.cxselect.js"></script>
<style>
body{background:#ddd;font:14px/1.7 tahoma,'\5fae\8f6f\96c5\9ed1',sans-serif;}
h1,h2,h3{font-size:36px;line-height:1;}
h2{font-size:24px;}
h3{font-size:18px;}
fieldset{margin:2em 0;}
fieldset legend{font-weight:bold;font-size:16px;line-height:2;}
select,button{padding:0.5em;}
a{color:#06f;text-decoration:none;}
a:hover{color:#00f;}
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script src="jquery.min.js"></script>
<script src="jquery.cxselect.js"></script>
<style>
body{background:#ddd;font:14px/1.7 tahoma,'\5fae\8f6f\96c5\9ed1',sans-serif;}
h1,h2,h3{font-size:36px;line-height:1;}
h2{font-size:24px;}
h3{font-size:18px;}
fieldset{margin:2em 0;}
fieldset legend{font-weight:bold;font-size:16px;line-height:2;}
select,button{padding:0.5em;}
a{color:#06f;text-decoration:none;}
a:hover{color:#00f;}