1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +00:00

Add getAttribute to fakeDom

This commit is contained in:
Jermolene 2015-08-10 20:32:13 +01:00
parent d3ca636a5b
commit 2eb645e5e5

View File

@ -49,6 +49,13 @@ Object.defineProperty(TW_Element.prototype, "nodeType", {
}
});
TW_Element.prototype.getAttribute = function(name) {
if(this.isRaw) {
throw "Cannot getAttribute on a raw TW_Element";
}
return this.attributes[name];
};
TW_Element.prototype.setAttribute = function(name,value) {
if(this.isRaw) {
throw "Cannot setAttribute on a raw TW_Element";