Home > Web Front-end > HTML Tutorial > How to hide controls in html

How to hide controls in html

藏色散人
Release: 2023-01-06 11:12:29
Original
4681 people have browsed it

How to hide the html control: 1. Hide through "getElementById("typediv1").style.visibility="hidden";"; 2. Hide through "style.display="none";" .

How to hide controls in html

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";//显示
Copy after login

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="";//显示
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template