Socket
Book a DemoInstallSign in
Socket

get-dataset

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-dataset

Get a DOM element's or an SVG Element's dataset. Works where .dataset isn't present such as in < IE11

0.0.4
latest
npmnpm
Version published
Weekly downloads
40
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

get dataset

Get a DOM element's or an SVG Element's dataset. Works where .dataset isn't present such as in < IE11.

Installation

npm install get-dataset

How to use

Require get-dataset:

var getDataset = require("get-dataset");

Given this element:

<div class="myDiv" data-prop="value1" data-composed-prop="value2"></div>

To retrieve the dataset:

getDataset(document.querySelector(".myDiv"));

returns:

{
    prop: "value1",
    composedProp: "value2"
};

CHANGELOG

0.0.3 - 0.0.4

  • Fix doc

0.0.2

  • Fix bug where properties of the returned object weren't camelcased. Issue #1.

LICENSE

MIT

Keywords

data

FAQs

Package last updated on 07 Feb 2015

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.