当前位置: 代码迷 >> JavaScript >> javascript控制displayIE下正常,火狐不行,什么原因, IE下调试一切正常,Opera下调试可以起作用,但会打乱布局,而火狐下根本就不起作,该怎么处理
  详细解决方案

javascript控制displayIE下正常,火狐不行,什么原因, IE下调试一切正常,Opera下调试可以起作用,但会打乱布局,而火狐下根本就不起作,该怎么处理

热度:622   发布时间:2012-02-02 23:57:14.0
javascript控制displayIE下正常,火狐不行,什么原因, IE下调试一切正常,Opera下调试可以起作用,但会打乱布局,而火狐下根本就不起作
以下原代码IE下调试一切正常,Opera下调试可以起作用,但会打乱布局,而火狐下根本就不起作用,不知道为何,请达人赐教!!

-----------------------------------------------源代码如下----------------------------------------------------

<script   language   =   "JavaScript ">
function   selectusertype()
{
if(document.regform.usertype[0].checked==1){
selectusertypeqy1.style.display= 'none ';
selectusertypeqy2.style.display= 'none ';
selectusertypeqy3.style.display= 'none ';
selectusertypegr1.style.display= 'block ';
selectusertypegr2.style.display= 'block ';
}
else
{
selectusertypeqy1.style.display= 'block ';
selectusertypeqy2.style.display= 'block ';
selectusertypeqy3.style.display= 'block ';
selectusertypegr1.style.display= 'none ';
selectusertypegr2.style.display= 'none ';
}
}
//--
</script>


<form   name= "regform "   method= "post "   action= "reg.asp "   onsubmit= "return   checkaddpro() ">
<div   id= "formwrapper ">
<FIELDSET>
<LEGEND> 用户名及类型 </LEGEND>
<br   />
<table   width= "600 "   border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "0 ">

<tr>
<td   width= "100 "   height= "24 "   align= "right "> <span   style= "color:   #666666 "> 用户类型: </span> </td>
<td   width= "200 "> <input   name= "usertype "   type= "radio "   value= "1 "   checked= "checked "   onClick= "selectusertype() "   />
<span   style= "color:   #1e7ace "> 个人用户 </span>
<input   type= "radio "   name= "usertype "   value= "2 "   onClick= "selectusertype() "   />
<span   style= "color:   #1e7ace "> 企业用户 </span> </td>
<td> <span   style= "color:   #666666 "> 请选择您的用户类型。 </span> </td>
</tr>

</table>

<br   />

</FIELDSET> <br   />

<FIELDSET>
<LEGEND> 基本资料 </LEGEND>
<br   />

<table   width= "600 "   border= "0 "   align= "center "   cellpadding= "0 "   cellspacing= "0 ">

<tr   id= "selectusertypegr1 ">
<td   width= "100 "   height= "24 "   align= "right "> <span   style= "color:   #666666 "> E-mail: </span> </td>
<td   width= "200 "> <input   type= "text "   name= "email "   id= "email "   size= "25 "   maxlength= "30 "   /> </td>
<td   width= "300 "   align= "left "> <div   id= "d_email "   style= "color:   #666666 "> 请输入您常用的电子邮箱地址。 </div> </td>
</tr>

<tr   id= "selectusertypegr2 ">
<td   width= "100 "   height= "24 "   align= "right "> <span   style= "color:   #666666 "> 真实姓名: </span> </td>
  相关解决方案