Home>Article>Web Front-end> How to hide the table in javascript
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.
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!