[ jQuery ] node.data()

Store arbitrary data associated with the specified element and/or return the value that was set.

USAGE

$('.test').data();

Moreover, we still can access data-whatever-whatever in data section.

Example

<div class="test" data-test-test="whatever"></div>
$('.test').data('test-test');

ref : https://api.jquery.com/jquery.data/,

https://stackoverflow.com/questions/5309926/how-to-get-the-data-id-attribute

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s