解决方案 »

  1.   


    if(document.getElementById("mycode").className.match("hidden")== "hidden")
    {}
      

  2.   

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
        <style>
            .field field-checkcode{ display:block;}
            .field field-checkcode hidden{ display:none;}
        </style>
        <script>
            $(function () {
                if ($("#mycode").attr("class") == "field field-checkcode") {
                    alert("显示");
                }
                else {
                    alert("隐藏");
                }
            })    </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <div class="field field-checkcode" id="mycode" style=""/>
        </form>
    </body>
    </html>