Permalink
Browse files

Added .rows property getter for tbody

  • Loading branch information...
1 parent 53f5763 commit 3288486d3dd447237d3c0b3031476c97478cf996 @davglass davglass committed Sep 8, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/jsdom/browser/index.js
@@ -389,6 +389,14 @@ dom.Element.prototype.__defineSetter__('innerHTML', function(html) {
});
+ dom.Element.prototype.__defineGetter__('rows', function() {
+ if (this.tagName.toUpperCase() == 'TBODY') {
+ return this.getElementsByTagName('tr');
+ } else {
+ //Throw Error
+ }
+ });
+
dom.Element.prototype.__defineGetter__('options', function() {
if (this.tagName.toUpperCase() == 'SELECT') {
return this.getElementsByTagName('option');

0 comments on commit 3288486

Please sign in to comment.