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, 11 insertions, 5 deletions
diff --git a/src/jqLite.js b/src/jqLite.js
index 134c1e17..68172fd8 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -220,7 +220,10 @@ JQLite.prototype = {
return this[0].innerHTML;
},
- parent: function() { return jqLite(this[0].parentNode);},
+ parent: function() {
+ return jqLite(this[0].parentNode);
+ },
+
clone: function() { return jqLite(this[0].cloneNode(true)); }
};
@@ -228,11 +231,14 @@ if (msie) {
extend(JQLite.prototype, {
text: function(value) {
var e = this[0];
- if (isDefined(value)) {
- e.innerText = value;
- }
// NodeType == 3 is text node
- return e.nodeType == 3 ? e.nodeValue : e.innerText;
+ if (e.nodeType == 3) {
+ if (isDefined(value)) e.nodeValue = value;
+ return e.nodeValue;
+ } else {
+ if (isDefined(value)) e.innerText = value;
+ return e.innerText;
+ }
},
trigger: function(type) {