Home > Web Front-end > JS Tutorial > Two ways to control the hidden appearance of js containers to prevent style changes_javascript skills

Two ways to control the hidden appearance of js containers to prevent style changes_javascript skills

WBOY
Release: 2016-05-16 16:51:03
Original
1149 people have browsed it

Method 1:

Copy code The code is as follows:

document.getElementById("Control ID") .style.visibility="hidden";
document.getElementById("Control ID").style.visibility="visible";

Method 2:
Copy code The code is as follows:

document.getElementById("Control ID").style.display="none";
document.getElementById("Control ID").style.display="inline";

After method one is hidden, the position of the page is still occupied by the control, but the Display similar to the .net verification control is not displayed. =Static
Method 2: The position of the page after hiding is not occupied, similar to Display=Dynamic of .net validation control
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