Returns a selection object that lazily represents an attribute with the name within the treespace element (or document).
Calling [get]AttrSelector#get returns the attribute in the specified element. Calling AttrSelector#set updates the attribute and calling AttrSelector#delete
removes it.
AttrSelector instances are also used as the target of the proxy object returned by attr
Example
import { attr } from'deleight/proxy/selector'; document.body.innerHTML = ` <div>I am a div</div> <p class="main">I am a paragraph</p> <section>I am a section</section> <article>I am an article</article> `; constslct = newAttrSelector('class', document.body); console.log(slct.get('p')); // main
Returns a selection object that lazily represents an attribute with the name within the
treespace
element (or document). Calling [get]AttrSelector#get returns the attribute in the specified element.Calling AttrSelector#set updates the attribute and calling AttrSelector#delete removes it.
AttrSelector instances are also used as the target of the proxy object returned by attr
Example