You can use getElementByTagName javascript pure function, like this:
function getStyle(elem, cssprop, cssprop2){
// IE
if (elem.currentStyle) {
return elem.currentStyle[cssprop];
// other browsers
} else if (document.defaultView &&
document.defaultView.getComputedStyle) {
return document.defaultView.getComputedStyle(elem,
null).getPropertyValue(cssprop2);
// fallback
} else {
return null;
}
}
var ths = document.getElementsByTagName('th');
var myLimit = 4;
var max = ths.length;
if (myLimit>max)
myLimit = max;
for (var i = 0;i < myLimit; i++) {
// do something with myarray[i]
var th = ths[i];
if (getStyle(th,'display','display')=='none')
alert('th in position '+i+' is decorated with display:none');
}
here is a live example working http://jsfiddle.net/aJ8MS/