<form>
<select onchange="test(this)">
<option>姓名</option>
<option>性别</option>
</select>
<script>
function test(o)
{
if(o.options[o.selectedIndex].text=="姓名")
document.all.mxh.innerHTML="<input name=mmm>"
else
document.all.mxh.innerHTML="<select name=mmm><option>男<option>女</select>"}
</script>
<div id=mxh></div>
</form>
<select onchange="test(this)">
<option>姓名</option>
<option>性别</option>
</select>
<script>
function test(o)
{
if(o.options[o.selectedIndex].text=="姓名")
document.all.mxh.innerHTML="<input name=mmm>"
else
document.all.mxh.innerHTML="<select name=mmm><option>男<option>女</select>"}
</script>
<div id=mxh></div>
</form>
<select onchange="test(this)">
<option>姓名</option>
<option>性别</option>
</select>
<script>
function test(o)
{
if(o.options[o.selectedIndex].text=="姓名")
document.all.mxh.innerHTML="<input name=mmm>"
else
document.all.mxh.innerHTML="<select name=mmm><option>男<option>女</select>"}
</script>
<div id=mxh></div>
</form>
<BODY>
<FORM METHOD=POST ACTION="" NAME="form1">
<select name="type" onchange="change(this)">
<option value="">選擇類別</option>
<option value="name">姓名</option>
<option value="sex">性別</option>
</select>
<div id=xxx></div>
</FORM>
</BODY>
<SCRIPT LANGUAGE="JavaScript">
<!--
function change(ob)
{
if(ob.value=="name"){
document.all.xxx.innerHTML="<input type=text name=aaa>";
}
if(ob.value=="sex"){
document.all.xxx.innerHTML="<select name=aaa><option value='男'>男</option><option value='女'>女</option></select>";
}}
//-->
</SCRIPT>