Hi - could someone kindly clarify if my understanding of what a data action is, is correct.

Data action to me seems like a way to create a static property within a user defined object or element, such that that property acts as a constant across all the instances of that particular type of object within which it's added.

Am I way off (:

bhawk90
—
2011-07-11T19:13:36Z —
#2

It's just a way to store extra data on an element. Instead of using custom HTML attributes, the data is stored internally by jQuery. So for example, if you wanted to keep track of which table cells have been clicked for whatever reason, you can do this:

It's not limited to simple values like in the code above though, you can store references to other HTML elements as well as other JavaScript objects using .data().

mnaseersj
—
2011-07-11T21:11:56Z —
#3

bhawk90 said:

It's just a way to store extra data on an element. Instead of using custom HTML attributes, the data is stored internally by jQuery. So for example, if you wanted to keep track of which table cells have been clicked for whatever reason, you can do this: