var mychar=document.getElementById("con").style.display="none"; function hidetext() {var mychar = document.getElementById("con").style.display="none";} function showtext() {var mychar = document.getElementById("con").style.display="block";}
var mychar=document.getElementById("con").style.display="none"
这一句是要执行一遍才能生效的。而执行是通过按钮来出发的。所以最好在HTML里面就先把con的display写成none
求完整的代码