1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-12-15 05:43:45 +01:00

S.attribute is the best option

This commit is contained in:
2023-11-22 21:29:40 +01:00
parent 10ed0802f2
commit efc5c34fc4
10 changed files with 58 additions and 53 deletions

View File

@@ -151,6 +151,11 @@ export function empty(el){
Array.from(el.children).forEach(el=> el.remove());
return el;
}
export function elementAttribute(element, op, key, value){
if(element instanceof HTMLElement)
return element[op+"Attribute"](key, value);
return element[op+"AttributeNS"](null, key, value);
}
import { isUndef } from "./helpers.js";
//TODO add cache? `(Map/Set)<el.tagName+key,isUndef>`
function isPropSetter(el, key){