Home>Article>Web Front-end> How to set css in js to hide

How to set css in js to hide

青灯夜游
青灯夜游 Original
2021-04-21 16:06:03 3435browse

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.

How to set css in js to hide

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:

How to set css in js to hide

[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!

Statement:
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