@dom-utils/selector-path

Returns unique selector for given element

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@dom-utils/selector-path
1.0.32 years ago2 years agoMinified + gzip package size for @dom-utils/selector-path in KB

Readme

@dom-utils/selector-path
Returns unique selector for given element
This project is cloned and modified version of micnews/css-path repository.

Usage

import { getSelectorPath } from '@dom-utils/selector-path'

getSelectorPath(node);

Options

  • useClassName
  • rootNode
  • minify
  • useNodeId

Option Usage

getSelectorPath(node, { useClassName: true, minify: true , useNodeId: true })