hidden屬性在html5中,只要存在,就是隱藏效果,而不論值為多少
要顯示元素,要刪除hidden屬性,而不是設置為false
<script type="text/javascript" async="true"> function qq_onclick(){ var text_2=document.getElementById("text_1"); text_2.removeAttribute("hidden"); } function qq_close(){ var text_1=document.getElementById("text_1"); text_1.setAttribute("hidden",true); } </script>