js中修改标签的hidden属性

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>

  

原文地址:https://www.cnblogs.com/z-books/p/5113820.html