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

@pluginjs/dom

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pluginjs/dom

A flexible modern dom js plugin.

  • 0.0.16
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-83.54%
Maintainers
2
Weekly downloads
 
Created
Source

Dom

npm package

dom is a utility JavaScript library for control dom interfaces.


API

query

Alias: parentNode.querySelector

Parameters

NameTypeDescription
selectorStringCSS selectors
parentHTMLElementDefault: document

Returns

NameTypeDescription
elementHTMLElementAn Element object representing the first element in the document that matches the specified set of CSS selectors, or null is returned if there are no matches.

queryAll

Alias: parentNode.querySelectorAll

Parameters

NameTypeDescription
selectorStringCSS selectors
parentHTMLElementDefault: document

Returns

NameTypeDescription
elementsArray<HTMLElement>A non-live Array containing one Element object for each element that matches at least one of the specified selectors or an empty Array in case of no matches.

find

Just like query, but it is Curried.

finds

Just like queryAll, but it is Curried.

remove

Parameters

NameTypeDescription
elementHTMLElement

html

Parameters

NameTypeDescription
contentStringhtml string
elementHTMLElementcontainer

Returns

NameTypeDescription
elementHTMLElementcontainer

children

Parameters

NameTypeDescription
elementHTMLElementcontainer

Returns

NameTypeDescription
elementsArray<HTMLElement>a live Array type HTMLCollection which contains all of the child elements of the node upon which it was called.

childrenSelect

Parameters

NameTypeDescription
selectorStringCSS selectors
parentHTMLElement

Returns

NameTypeDescription
elementsArray<HTMLElement>a Array which contains all of the child elements that matches the specified set of CSS selectors .

getSiblings

Parameters

NameTypeDescription
elementHTMLElement

Returns

NameTypeDescription
elementHTMLElement

parent

Parameters

NameTypeDescription
elementHTMLElement

Returns

NameTypeDescription
elementHTMLElementparentNode

parseHTML

Support tagged template.

Parameters

NameTypeDescription
htmlStringString

Returns

NameTypeDescription
elementHTMLElement

setObjData

Parameters

NameTypeDescription
keyString
valueAny
elHTMLElement

Returns

NameTypeDescription
elementHTMLElement

getObjData

Parameters

NameTypeDescription
keyString
elHTMLElement

Returns

NameTypeDescription
elementHTMLElement

clone

Parameters

NameTypeDescription
elementHTMLElement

Returns

NameTypeDescription
elementHTMLElement

empty

Parameters

NameTypeDescription
elementHTMLElement

Returns

NameTypeDescription
elementHTMLElement

prev

Alias: node.previousElementSibling

Parameters

NameTypeDescription
elementHTMLElement

Returns

NameTypeDescription
elementHTMLElement

next

Alias: node.nextElementSibling

Parameters

NameTypeDescription
elementHTMLElement

Returns

NameTypeDescription
elementHTMLElement

attr

Parameters

NameTypeDescription
args`StringObject`

Returns

NameTypeDescription
elementHTMLElement

removeAttribute

Parameters

NameTypeDescription
keyString

Returns

NameTypeDescription
elementHTMLElement

dataset

Parameters

NameTypeDescription
args`StringObject`

Returns

NameTypeDescription
elementHTMLElement

text

Parameters

NameTypeDescription
contentStringtextContent
elementHTMLElement

Returns

NameTypeDescription
elementHTMLElement

append

Parameters

NameTypeDescription
childHTMLElementchildNode
elHTMLElementparentNode

Returns

NameTypeDescription
elHTMLElementparentNode

prepend

Parameters

NameTypeDescription
childHTMLElementchildNode
elHTMLElementparentNode

Returns

NameTypeDescription
elHTMLElementparentNode

insertBefore

Parameters

NameTypeDescription
newElementHTMLElementnew element
elHTMLElementparentNode

Returns

NameTypeDescription
elHTMLElementparentNode

insertAfter

Parameters

NameTypeDescription
newElementHTMLElementnew element
elHTMLElementparentNode

Returns

NameTypeDescription
elHTMLElementparentNode

wrap

Parameters

NameTypeDescription
wrapElementHTMLElementwrapper
elHTMLElement

Returns

NameTypeDescription
wrapElementHTMLElementwrapper

wrapInner

Parameters

NameTypeDescription
newElementHTMLElementnew element
wrapHTMLElementwrapper

Returns

NameTypeDescription
wrapHTMLElementwrapper

wrapAll

Parameters

NameTypeDescription
wrapElementHTMLElementwrapper
elementListArray<HTMLElement>

Returns

NameTypeDescription
wrapElementHTMLElementwrapper

unwrap

Parameters

NameTypeDescription
elHTMLElement

Returns

NameTypeDescription
elHTMLElement

clearChild

Parameters

NameTypeDescription
elHTMLElementcontainer

Returns

NameTypeDescription
elHTMLElementcontainer

parentWith

Parameters

NameTypeDescription
fnHTMLElement => Boolean
elHTMLElement

Returns

NameTypeDescription
elHTMLElementparentNode

clearData

Parameters

NameTypeDescription
elHTMLElement

Returns

NameTypeDescription
elHTMLElement

contains

Parameters

NameTypeDescription
elHTMLElement
parentHTMLElement

Returns

NameTypeDescription
boolBoolean

closest

Parameters

NameTypeDescription
selectorString
elHTMLElement

Returns

NameTypeDescription
parentElementHTMLElement

nextElementWith

Parameters

NameTypeDescription
fnHTMLElement => Boolean
elHTMLElement

Returns

NameTypeDescription
nextElementHTMLElement

fade

Parameters

NameTypeDescription
typeString
Options{ duration: Number, callback: Function }
elementHTMLElement

Returns

NameTypeDescription
nextElementHTMLElement

fadeOut

Parameters

NameTypeDescription
Options{ duration: Number, callback: Function }
elementHTMLElement

Returns

NameTypeDescription
nextElementHTMLElement

fadeIn

Parameters

NameTypeDescription
Options{ duration: Number, callback: Function }
elementHTMLElement

Returns

NameTypeDescription
nextElementHTMLElement

Browser support

Tested on all major browsers.

SafariChromeFirefoxEdgeOpera
Latest ✓Latest ✓Latest ✓Latest ✓Latest ✓

License

@pluginjs/dom is Licensed under the GPL-v3 license.

If you want to use @pluginjs/dom project to develop commercial sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary.

For purchase an Commercial License, contact us purchase@thecreation.co.

Copyright (C) 2018 Creation Studio Limited.

FAQs

Package last updated on 02 Aug 2018

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