Home > Article > Web Front-end > How to hide controls in html
How to hide the html control: 1. Hide through "getElementById("typediv1").style.visibility="hidden";"; 2. Hide through "style.display="none";" .
The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.
HTML control hiding
The visibility of the div can control the display and hiding of the div, but the page appears blank after hiding:
style="visibility: none;" document.getElementById("typediv1").style.visibility="hidden";//隐藏 document.getElementById("typediv1").style.visibility="visible";//显示
By setting the display attribute You can hide the div and release the occupied page space, as follows
style="display: none;" document.getElementById("typediv1").style.display="none";//隐藏 document.getElementById("typediv1").style.display="";//显示
Recommended learning: "html video tutorial"
The above is the detailed content of How to hide controls in html. For more information, please follow other related articles on the PHP Chinese website!