- var myNode = nativeNode,
- $myNode = $(nativeNode);
+ this.nativeNode = nativeNode;
+ this._$ = $(nativeNode);
+};
+
+$.extend(ElementNode.prototype, {
+ nodeType: Node.ELEMENT_NODE,
+
+ getTagName: function() {
+ return this.nativeNode.tagName.toLowerCase();
+ },
+
+ append: function(documentNode) {
+ this._$.append(documentNode.nativeNode);
+ },
+
+ contents: function() {
+ var toret = [];
+ this._$.contents().each(function() {
+ if(this.nodeType === Node.ELEMENT_NODE)
+ toret.push(new ElementNode(this));
+ else if(this.nodeType === Node.TEXT_NODE)
+ toret.push(new TextNode(this));
+ });
+ return toret;
+ },