dcsimg
 

Submitted by: Srinath M S(srinath_ms@yahoo.com)

Wednesday Dec 6th 2017 by Srinath M S

Language: Web, Beginner: Intermediate - Learn how to store and retrieve data from the data attributes.

We can store data in the elements through HTML5's data attributes. See below for an example on how to store and retrieve data from the data attributes.

The values are added to the anchor element through the data-value and data-options attributes. This is how you access the values:

alert('The ' + $("#elink").data("value") + ' name is ' + $("#elink").data("options").cn);
Home
Mobile Site | Full Site
Copyright 2018 © QuinStreet Inc. All Rights Reserved