`

可初始化省市区,级联菜单

阅读更多
1、引入jQuery插件
2、示例代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>demo</title>
<script src="jquery.js" type="text/javascript"></script>
<script src="data.js" type="text/javascript"></script>
<script src="datajs.js" type="text/javascript"></script>
<style type="text/css">
	#province{ width:90px; margin-left:5px}
	#city{ width:130px; margin-left:5px}
	#hometown{ width:160px; margin-left:5px}
</style>
</head>
<body>
<select id="province"></select>
<select id="city"></select>
<select id="hometown"></select>
</body>
</html>
<script type="text/javascript">
//设定四川、成都、成都市为默认选中状态
$(document).ready(function(){init("province","四川","city","成都","hometown","成都市");});
</script>



注:插件见附件
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics