Home>Article>Web Front-end> How to set css in js to hide
Implementation method: First use the "document.getElementById("id value")" statement to obtain the specified element object; then use the "element object.style.display="none"" statement to control the css and achieve hiding Effect.
The operating environment of this tutorial: windows7 system, javascript1.8.5&&CSS3 version, Dell G3 computer.
Use js to hide or show css
Known:
页面ID为login的元素页面ID为regist的元素
Code:
Rendering:
[Recommended learning:javascript advanced tutorial]
The above is the detailed content of How to set css in js to hide. For more information, please follow other related articles on the PHP Chinese website!