aboutsummaryrefslogtreecommitdiffstats
path: root/src/jqLite.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/jqLite.js')
-rw-r--r--src/jqLite.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index 6fc16e57..d4c5492c 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -34,7 +34,15 @@ function jqClearData(element) {
}
function JQLite(element) {
- this[0] = element;
+ if (element.length && element.item) {
+ for(var i=0; i < element.length; i++) {
+ this[i] = element[i];
+ }
+ this.length = element.length;
+ } else {
+ this[0] = element;
+ this.length = 1;
+ }
}
JQLite.prototype = {
@@ -111,7 +119,11 @@ JQLite.prototype = {
},
append: function(node) {
- this[0].appendChild(jqLite(node)[0]);
+ var self = this[0];
+ node = jqLite(node);
+ foreach(node, function(child){
+ self.appendChild(child);
+ });
},
remove: function() {