<script type="text/javascript" language="javascript">
<!--
function switchstatus(obj){
if (document.getElementById(obj).style.display="none"){
document.getElementById(obj).style.display="block";       

}else{
document.getElementById(obj).style.display="none";       

}
}
//-->
</script>
我这个js写的对吗,运行的时候 总是点击按钮第一次是是对的,第二次点击不对了 如何改啊

解决方案 »

  1.   

    if (document.getElementById(obj).style.display=="none")
      

  2.   

    if中是判断要用==
    O(∩_∩)O哈哈~ LZ这是犯糊涂了
      

  3.   

    我分不多,想借宝地请教一个问题:
    if RadioGroup1.value=="1" then {
      if request("flag")="send" then
    strDate = request("d")
    if not isdate(strDate) then Response.Write "<font color=red>请先选择日期!</font>" : Response.End
    nowDT = cdate(strDate)
      strNow=cstr(year(nowDT))
      iMonth=month(nowDT)
      if iMonth<10 then strNow=strNow & cstr(0)
      strNow=strNow & cstr(iMonth)
      iDay=day(nowDT)
      if iDay<10 then strNow=strNow & cstr(0)
      strNow=strNow & cstr(iDay)
    set fso=server.CreateObject("Scripting.FileSystemObject")
    if fso.FileExists(server.MapPath("jcfiles\" & strNow & ".xls")) then
    Response.Write "<a href=jcfiles/" & strNow & ".xls" & " target=_blank><b>甲醇生产日报" & strDate & "</b></a>"
    else
    Response.Write "<font color=red>甲醇生产日报" & strDate & "不存在!</font>"
    end if
    end if
    }
    else if RadioGroup1.value=="2" then
    {  
      if request("flag")="send" then
    strDate = request("d")
    if not isdate(strDate) then Response.Write "<font color=red>请先选择日期!</font>" : Response.End
    nowDT = cdate(strDate)
      strNow=cstr(year(nowDT))
      iMonth=month(nowDT)
      if iMonth<10 then strNow=strNow & cstr(0)
      strNow=strNow & cstr(iMonth)
      iDay=day(nowDT)
      if iDay<10 then strNow=strNow & cstr(0)
      strNow=strNow & cstr(iDay)
    set fso=server.CreateObject("Scripting.FileSystemObject")
    if fso.FileExists(server.MapPath("files\" & strNow & ".xls")) then
    Response.Write "<a href=files/" & strNow & ".xls" & " target=_blank><b>原稳生产日报" & strDate & "</b></a>"
    else
    Response.Write "<font color=red>原稳生产日报" & strDate & "不存在!</font>"
    end if
    end if
    }
    end if想借用一组单选按钮,根据选中不同的单选按钮,进行相应的读取文件操作,但总报错,请会的朋友指点一下,本来有4个单选钮组成,这里写了2个。