🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
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
npm
Version published
Weekly downloads
3
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