<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>sss</title>
</head>
<form name="form1">
<table border="0" align="center" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height="30">
<tr>
<td height="24">
<select name="type" onclick='if(this.options[this.selectedIndex].text=="3"){document.all("dwmc").style.display="";document.all("xm").style.display=""}else{document.all("dwmc").style.display="none";document.all("xm").style.display="none"}'>
<option value="1">按身份证号查询 </option>
<option value="2">按个人帐号查询 </option>
<option value="3">按姓名加单位名称查询 </option>
</select>
<input type="text" name="text1" size="12">
<td id="dwmc" style="display:none">
单位名称:<input type="text" name="text1" size="12">
</td>
<td id="xm" style="display:none">
姓名:<input type="text" name="text2" size="12">
</td>
</tr>
</table>
</form>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>sss</title>
</head>
<form name="form1">
<table border="0" align="center" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" height="30">
<tr>
<td height="24">
<select name="type" onclick='if(this.options[this.selectedIndex].text=="3"){document.all("dwmc").style.display="";document.all("xm").style.display=""}else{document.all("dwmc").style.display="none";document.all("xm").style.display="none"}'>
<option value="1">按身份证号查询 </option>
<option value="2">按个人帐号查询 </option>
<option value="3">按姓名加单位名称查询 </option>
</select>
<input type="text" name="text1" size="12">
<td id="dwmc" style="display:none">
单位名称:<input type="text" name="text1" size="12">
</td>
<td id="xm" style="display:none">
姓名:<input type="text" name="text2" size="12">
</td>
</tr>
</table>
</form>
</body>
</html>
另外if(a==b)中要用"=="来判断而不是"=","="是赋值按我下面的写法可以通过,我测试过了,你试试!onclick='if(this.options[this.selectedIndex].value=="3"){document.all("dwmc").style.display="";document.all("xm").style.display=""}else{document.all("dwmc").style.display="none";document.all("xm").style.display="none"}'