Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81147 views
1
// DOM-Level-1-compliant structure
2
var NodePrototype = require('./node');
3
var ElementPrototype = module.exports = Object.create(NodePrototype);
4
5
var domLvl1 = {
6
tagName: "name"
7
};
8
9
Object.keys(domLvl1).forEach(function(key) {
10
var shorthand = domLvl1[key];
11
Object.defineProperty(ElementPrototype, key, {
12
get: function() {
13
return this[shorthand] || null;
14
},
15
set: function(val) {
16
this[shorthand] = val;
17
return val;
18
}
19
});
20
});
21
22