Socket
Socket
Sign inDemoInstall

dom7

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dom7

Minimalistic JavaScript library for DOM manipulation, with a jQuery-compatible API


Version published
Weekly downloads
746K
decreased by-5.58%
Maintainers
1
Weekly downloads
 
Created

What is dom7?

Dom7 is a minimalistic JavaScript library for DOM manipulation, designed to be used with frameworks like Framework7. It provides a simple and efficient API for common DOM operations such as element selection, event handling, and manipulation.

What are dom7's main functionalities?

Element Selection

Dom7 allows you to select elements using a simple syntax similar to jQuery. The `$$` function is used to select all `div` elements in the document.

const $$ = Dom7;
const elements = $$('div');

Event Handling

Dom7 provides an easy way to attach event listeners to elements. In this example, a click event listener is added to all `button` elements, which triggers an alert when any button is clicked.

const $$ = Dom7;
$$('button').on('click', function() {
  alert('Button clicked!');
});

Element Manipulation

Dom7 allows you to manipulate the content of elements. This example changes the text content of all `p` elements to 'New text content'.

const $$ = Dom7;
$$('p').text('New text content');

Class Management

Dom7 makes it easy to manage classes on elements. This example adds the class 'new-class' to all `div` elements.

const $$ = Dom7;
$$('div').addClass('new-class');

CSS Manipulation

Dom7 allows you to manipulate the CSS properties of elements. This example sets the text color of all `div` elements to red.

const $$ = Dom7;
$$('div').css('color', 'red');

Other packages similar to dom7

Keywords

FAQs

Package last updated on 13 Dec 2021

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