Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wordpress/dom

Package Overview
Dependencies
Maintainers
15
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/dom

DOM utilities module for WordPress.

  • 2.14.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
82K
decreased by-32.86%
Maintainers
15
Weekly downloads
 
Created

What is @wordpress/dom?

@wordpress/dom is a utility package for manipulating and interacting with the DOM (Document Object Model) in WordPress projects. It provides a set of functions to handle common DOM operations, making it easier to work with elements, attributes, and events in a WordPress environment.

What are @wordpress/dom's main functionalities?

Focus Management

This feature allows developers to manage focus within the DOM, such as focusing the first tabbable element within a container. This is particularly useful for accessibility and ensuring a smooth user experience.

const { focus } = require('@wordpress/dom');

// Example: Focus the first tabbable element within a container
focus.focusTabbable(containerElement);

Element Manipulation

Provides utility functions to manipulate DOM elements, such as removing an element from the DOM. This simplifies common tasks that would otherwise require more verbose native DOM methods.

const { remove } = require('@wordpress/dom');

// Example: Remove an element from the DOM
remove(elementToRemove);

Attribute Management

Allows for easy management of element attributes, such as toggling an attribute's presence or value. This is useful for dynamically updating the DOM based on user interactions or application state.

const { toggleAttribute } = require('@wordpress/dom');

// Example: Toggle an attribute on an element
toggleAttribute(element, 'aria-hidden', true);

Other packages similar to @wordpress/dom

Keywords

FAQs

Package last updated on 03 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc