10

I want to know how to identify table row is visible or not. I want to resolve by using jQuery

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49
naveen gupta
  • 107
  • 1
  • 1
  • 6
  • 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
  • 1
    A 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 Answers3

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
2

Is visible should help you :-

$('#table_row').is(':visible')
Jayendra
  • 52,349
  • 4
  • 80
  • 90
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
  • 1
    it should be `none=="none"` and not `=` because that way, you're assigning it to the variable. – Slim Sep 03 '14 at 07:36