Creates Proxy object that access to an element's attributes.
This class simplifies attribute manipulation to the target element.
▶Element's attribute manipulation
Element's attribute manipulation
const element = document.createElement('color-preview'); const attr = new ElementAttributesProxy(element); console.log(attr.color); // or attr['color'] // undefined attr.color = '#ff0000'; console.log(attr.color); // '#ff0000' console.log('color' in attr); // true console.log(Object.keys(attr)); // ['color'] delete attr.color;
new
ElementAttributesProxy(target: Element)
Creates a new Proxy object but the instance is not the NodeStructure class.