What is the correct way to store some data in the <a> `binding tag?
I usually use data-*** to store some data.
<a href="#" data-address="some data">click</a> I can get it in jquery using
alert($("a").data("address")); It works great. but I want to know, is this the right way to do and are there any compatibility issues?
or I need to use rel ie:
<a href="#" rel="some data">click</a> alert($("a").attr("rel")); i updated the fiddle http://jsfiddle.net/suhailvs/XYZQK/
the rel attribute when accessing the a tag is intended for search engines to determine the relationship between the document and the one with which it refers.
the data attribute can be used by developers to create custom attributes while storing data in it.
assuming data-*** right way to store some data.
DO NOT USE REL TO STORE CUSTOMS DATA
COMPATIBILITY COMPLIANCE
Since the data and rel attributes (referencing a tags) are ignored by browsers, you can use both, either / or. Although it is better to use the data tag to store "data".
GREAT SEARCH RESULTS

if you want search engines to return specific links or elements as data describing your content, for example, page description, publication date, page image, etc., you can read βrich search resultβ and βrich excerpts from Google .
this link will start you Rich search results or About rich fragments and structured data
Here's an article on why you should not use rel, and what you could try if you are not sure about the use of data.
http://www.sitepoint.com/rel-not-a-custom-attribute/
Bootstrap already uses data heavily, so there is no reason not to accept it even more.
Store data correctly with custom data attributes that begin with "data -".
It complies with the HTML5 specification.
See the following link.
http://www.w3.org/html/wg/drafts/html/master/dom.html#embedding-custom-non-visible-data-with-the-data- * -attributes
You are abusing data- attributes, so for your use case none of them is correct ( rel never is).
I would either modify the HTML structure to accommodate additional information (i.e. use other tags), or just save the contents in a JavaScript object to begin with. Preventing all of this in one binding shortcut is not a good idea.