问答详情
源自:3-5 显示和隐藏(display属性)

运行程序不正确

提交后结果有些显示不正确

提问者:光子自旋 2015-11-02 20:37

个回答

  • Uestc_L
    2015-11-08 10:55:53

    function hidetext()  

    {  

    var mychar = document.getElementById("con");

            mychar.style.display = "none";    /*none要用""包含起来*/

    }  

    function showtext()  

    {  

    var mychar = document.getElementById("con");

            mychar.style.display = "block";

    }



  • qq_注定单身微猫_0
    2015-11-08 10:50:43

     function hidetext()  

    {  

    var mychar = document.getElementById("con");

            document.getElementById("con").style.display="none";

    }  

    function showtext()  

    {  

    var mychar = document.getElementById("con");

            document.getElementById("con").style.display="block"

    }