@ultraq/dom-utils

WebJar for @ultraq/dom-utils

License

License

GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

ultraq__dom-utils
Last Version

Last Version

0.4.0
Release Date

Release Date

Type

Type

jar
Description

Description

@ultraq/dom-utils
WebJar for @ultraq/dom-utils
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/ultraq/dom-utils

Download ultraq__dom-utils

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/ultraq__dom-utils/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>ultraq__dom-utils</artifactId>
    <version>0.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/ultraq__dom-utils/
implementation 'org.webjars.npm:ultraq__dom-utils:0.4.0'
// https://jarcasting.com/artifacts/org.webjars.npm/ultraq__dom-utils/
implementation ("org.webjars.npm:ultraq__dom-utils:0.4.0")
'org.webjars.npm:ultraq__dom-utils:jar:0.4.0'
<dependency org="org.webjars.npm" name="ultraq__dom-utils" rev="0.4.0">
  <artifact name="ultraq__dom-utils" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='ultraq__dom-utils', version='0.4.0')
)
libraryDependencies += "org.webjars.npm" % "ultraq__dom-utils" % "0.4.0"
[org.webjars.npm/ultraq__dom-utils "0.4.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

dom-utils

Build Status Coverage Status npm Bundlephobia minified size

A collection of utilities for working with the DOM.

Installation

npm install @ultraq/dom-utils

API

addEventDelegate(element, eventName, selector, handler)

Add an event listener to element that only fires when the target of the event matches selector.

  • element:
  • eventName:
  • selector:
  • handler:

clearChildren(element)

Removes all of an element's child nodes.

  • element

deserialize(htmlString)

Deserialize an HTML string into a document fragment.

  • htmlString

parseJsonFromElement(selector)

Parse the text content of the element picked out by the given selector as JSON data, returning it as an object. Returns null if no data could be read.

  • selector: a CSS selector for picking out the HTML element that contains the JSON data
  • scope: optional, the DOM tree to run the selector over. Defaults to the current document.

serialize(documentOrFragment)

Serialize a document or document fragment into an HTML string.

  • documentOrFragment

Versions

Version
0.4.0
0.3.2
0.1.1