browser-x
Version:
A partial implementation of the W3C DOM API on top of an HTML5 parser and serializer.
24 lines (19 loc) • 497 B
JavaScript
var Node = require('./node');
function CharacterData(ownerDocument, name, data, type) {
Node.call(this, ownerDocument, name, data, type);
}
CharacterData.prototype = Object.create(Node.prototype, {
length: {
get: function() {
return this.nodeValue.length;
}
},
data: {
get: function() {
return this.nodeValue;
}
}
});
CharacterData.prototype.constructor = CharacterData;
module.exports = CharacterData;
;