Where is the data stored on the element?
Hey Guys. I am new to the .data() function and was just wondering where exactly does the data get stored on an element.
I have the following code
- $("#store").click(function () { $("#div1").data("key1",1234);
- $("#div1").data("key2", "Joe Marini"); });
<div id="div1" data-key3="data attribute">Sample DIV</div>
When I checked the DOM for the the div one tag, I couldn't find any keys and values and any of the attributes, just the data-key3 value.
Also what is the difference between using the data() function and JSON. Does it work in conjunction with JSON?