+$.extend(DocumentNodeElement.prototype, {
+ append: function(params) {
+ var to_append = DocumentNodeElement.createDOM(params.tag, params.klass);
+ this.$element.append(to_append);
+ return documentElementFromHTMLElement(to_append);
+ },
+ after: function(params) {
+ var to_append = DocumentNodeElement.createDOM(params.tag, params.klass);
+ this.$element.after(to_append);
+ return documentElementFromHTMLElement(to_append);
+ }
+});
+
+DocumentNodeElement.createDOM = function(tag, klass) {
+ var dom = $('<' + tag + '>');
+ if(klass)
+ dom.attr('class', klass);
+ return dom;
+};
+