Index: trunk/parsers/wikidom/lib/hype/bases/es.DocumentModelNode.js |
— | — | @@ -156,6 +156,19 @@ |
157 | 157 | }; |
158 | 158 | |
159 | 159 | /** |
| 160 | + * Gets an element attribute value. |
| 161 | + * |
| 162 | + * @method |
| 163 | + * @returns {Mixed} Value of attribute, or null if no such attribute exists |
| 164 | + */ |
| 165 | +es.DocumentModelNode.prototype.getElementAttribute = function( key ) { |
| 166 | + if ( this.element.attributes && key in this.element.attributes ) { |
| 167 | + return this.element.attributes[key]; |
| 168 | + } |
| 169 | + return null; |
| 170 | +}; |
| 171 | + |
| 172 | +/** |
160 | 173 | * Gets the content length. |
161 | 174 | * |
162 | 175 | * FIXME: This method makes assumptions that a node with a data property is a DocumentModel, which |