Html对象的显示与隐藏

<script language="javascript">
function SetTextBox()
{
 //alert(document.getElementsByName("ForSpec").item(0).tagName);
 //alert(document.getElementsByName("WebUserControlPropertyEditorTriStateMustBeSponsorToSpeak:RadioButtonListValue").item(0).parentTextEdit);
 //alert(document.getElementsByName("WebUserControlPropertyEditorTriStateMustBeSponsorToSpeak:RadioButtonListValue").length);
 if (document.getElementsByName("WebUserControlPropertyEditorTriStateMustBeSponsorToSpeak:RadioButtonListValue").item(3).checked)
 {
 document.getElementsByName("ForSpec").item(0).style.display =  "block";      用display属性隐藏后不占位
 //document.getElementsByName("ForSpec").item(0).style.visibility = "visible";   用visiblity属性隐藏后要占位

 //alert("show");
 }
 else
 {
 document.getElementsByName("ForSpec").item(0).style.display =  "none";
 //document.getElementsByName("ForSpec").item(0).style.visibility = "hidden";
 //alert("hide");
 }
}

</script>

posted @ 2005-10-18 13:02  Ready!  阅读(1206)  评论(0)    收藏  举报