I want to know how to identify table row is visible or not. I want to resolve by using jQuery
Asked
Active
Viewed 2.5k times
10
-
Possibly related *[jquery selector to count the number of visible table rows?](http://stackoverflow.com/questions/2931893/jquery-selector-to-count-the-number-of-visible-table-rows)* – jensgram Sep 26 '11 at 11:32
-
1A very cryptic question to start with. You need to be a bit generous while giving out information about your problem, the context and what you have tried so far. You are welcome to share your code as weel. These efforts from your side will help others willing to provide you some answer. – Kangkan Sep 26 '11 at 11:33
3 Answers
23
You can use the :visible
pseudo-selector, and the is
method, which returns a boolean value:
if($("#tableRowId").is(":visible")) {
//It's visible
}

James Allardice
- 164,175
- 21
- 332
- 312
1
This should work:
var none=$("table tr").css("display")
if(none=="none"){
// Row is invisible
} else{
// Row is visible
}

Dylan Vander Berg
- 1,809
- 1
- 22
- 37

Tushar Ahirrao
- 12,669
- 17
- 64
- 96
-
1it should be `none=="none"` and not `=` because that way, you're assigning it to the variable. – Slim Sep 03 '14 at 07:36