Class MemberSelector

Returns a selection object that lazily represents a property with the name within the treespace element (or document). Calling [get]MemberSelector#get returns the property in the specified element. Calling MemberSelector#set updates the property and calling MemberSelector#delete deletes it.

MemberSelector instances are used as the target of the proxy object returned by member

Example

import { MemberSelector } from 'apption';
document.body.innerHTML = `
<div>I am a div</div>
<p>I am a paragraph</p>
<section>I am a section</section>
<article>I am an article</article>
`;
const slct = new MemberSelector('textContent', document.body);
console.log(slct.get('div')); // I am a div

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

#private: any
name: string
treespace?: Element

Methods

  • Parameters

    • key: any

    Returns void

  • Parameters

    • key: any

    Returns any

  • Returns any

  • Parameters

    • key: any
    • value: any

    Returns void