[js]实现简单的省市二级联动下拉选择菜单

  本文实例讲述了js实现的全国省市二级联动下拉选择菜单。分享给大家供大家参考。具体如下:

  运行效果截图如下:
  [js]实现简单的省市二级联动下拉选择菜单_第1张图片

  主要HTML代码:


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js全国省市二级联动下拉选择菜单title>
head>
<body>
<script language="javascript" src="city.js">script>
<form action="" method=post name=form1>
<table width=300 border=0 cellspacing="0" cellpadding="1" !bgcolor=#FFFDE6>
<tr>
<td class="black_con9" align="right">省份:td>
<td class="black_con9">
<select name="selectp" onChange="selectcityarea('selectp','selectc','form1');">
<option value="0" selected>选择省份option>
select>
td>
tr>
<tr>
<td class="black_con9" align="right">县/市:td>
<td class="black_con9">
<select name="selectc">
<option value="0" selected>选择城市option>
select>
td>
tr>
table>
form>
<script language="javascript">
first("selectp","selectc","form1",0,0);
script>
body>
html>

你可能感兴趣的:(建站技术文)