Skip to main content

Built and signed on GitHub Actions

A library for building front-end applications.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a day ago (1.6.2)
class ElementAttributesProxy

Creates Proxy object that access to an element's attributes.

This class simplifies attribute manipulation to the target element.


Examples

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;

Constructors

new
ElementAttributesProxy(target: Element)

Creates a new Proxy object but the instance is not the NodeStructure class.

Index Signatures

[key: string] : string

Add Package

deno add @akiraohgaki/chirit

Import symbol

import ElementAttributesProxy from "@akiraohgaki/chirit";

---- OR ----

Import directly with a jsr specifier

import ElementAttributesProxy from "jsr:@akiraohgaki/chirit";

Add Package

npx jsr add @akiraohgaki/chirit

Import symbol

import ElementAttributesProxy from "@akiraohgaki/chirit";

Add Package

yarn dlx jsr add @akiraohgaki/chirit

Import symbol

import ElementAttributesProxy from "@akiraohgaki/chirit";

Add Package

pnpm dlx jsr add @akiraohgaki/chirit

Import symbol

import ElementAttributesProxy from "@akiraohgaki/chirit";

Add Package

bunx jsr add @akiraohgaki/chirit

Import symbol

import ElementAttributesProxy from "@akiraohgaki/chirit";