Home > Web Front-end > Front-end Q&A > How to hide rows in javascript

How to hide rows in javascript

藏色散人
Release: 2022-01-18 11:49:41
Original
2994 people have browsed it

How to hide rows in javascript: 1. Create an HTML sample file; 2. Define a table; 3. Use js code "function setDetailMsgRow(rowID, btn) {...}" to hide the table A certain line will do.

How to hide rows in javascript

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

How to hide rows in javascript?

js controls hiding or displaying a certain row of the table

The main JS is as follows: (compatible with browsers: IE9, FireFox, Chrome, 360 safe)

            var row = document.getElementById(rowID);
            if (row != null) {
                if (row.style.display == (document.all ? "block" : "table-row")) {
                    row.style.display = "none";
                }
                else {
                    row.style.display = (document.all ? "block" : "table-row");
                }
            }
Copy after login

The rendering is as follows:

How to hide rows in javascript

##All HTML:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="testWeb.WebForm1" %>
 

 


    
 
    


    
bb44bb
cc44cc
dd44dd
ee44ee
Copy after login
Recommended learning: "

js Basic Tutorial"

The above is the detailed content of How to hide rows in javascript. For more information, please follow other related articles on the PHP Chinese website!

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