How to hide an empty row?

Welcome to our community

Be apart of something great, join today!

Antoniorth

Newbie
Messages
4
Reaction score
0
Points
1
Hello,

I have a very simple 3 x 10 grid, but depending on the input I want to hide various rows that do not contain any data.
 

Bernardned

Newbie
Messages
2
Reaction score
0
Points
1
You didn't post any html, but this seems easy enough to psuedocode. Depending on the content, you can check if a certain html element has any text to it.

JavaScript:
if (element.innerText === "") {
  element.style.display = "none";
}

How to do it if you want to check if the html element has any children elements:

JavaScript:
if (!element.hasChildNodes()) {
  element.style.display = "none";
}
 
  • Advertisement
  • Advertisement
  • Advertisement

    Top