Home>Article>Web Front-end> How to hide the table in javascript

How to hide the table in javascript

藏色散人
藏色散人 Original
2021-04-27 10:11:35 4411browse

How to hide a table in javascript: first create an HTML sample file; then create a table in the body; finally implement it through the js code "getElementById("table1").style.display='block';" Just hide it.

How to hide the table in javascript

The operating environment of this article: windows7 system, javascript version 1.8.5, Dell G3 computer.

Javascript displays and hides a table

The document.getElementById("Element ID") method and the style.display attribute of the element are mainly used here. The file name is doHide.htm, and the code is as follows:

      

这是一个表格 单元格2 单元格3 单元格4 单元格5
1 2 3 4 5
2 2 2 2 2

[Recommended learning:javascript advanced tutorial]

The above is the detailed content of How to hide the table in javascript. 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