用javaScript控制DIV的显示
function showDiv(targetid)
{
if (document.getElementById){
var target=document.getElementById(targetid);
alert(target.style.display);
if (target.style.display =="block" || target.style.display == "" ){
alert('block');
target.style.display="none";
}
else if(target.style.display == "none")
{
alert('none');
target.style.display = "block";
}
}
}
<form id="frm1" action="">
<td>
<input type="text" name="caption" size="62" />
<input type="button" name="annex" value="添加附件"
onclick="showDiv('annexDiv');" />
<form action="" id="frm2">
<div id="annexDiv" style="display: none;">
<input type="text" name="annex" size="62" />
<input type="button" name="addAnnex" value="浏览" />
<input type="button" name="delAnnex" value="删除" onclick="showDiv('annexDiv');" />
</div>
</form>
</td>
</form>