what does jQuery data() function do

Its really useful for associating various objects, strings, arrays, etc with a DOM element. Here is a fun hypothetical use: This would select every a tag, and set Orange if its odd, or Purple if its even. This is not the most optimal way to write this code if this is what you really wanted to do, but it does illustrate … Read more