I was reading the jquery documentation and I do not quite understand what the main difference between two is since they both serve to store data from an html tag.
I was reading the jquery documentation and I do not quite understand what the main difference between two is since they both serve to store data from an html tag.
The only difference between .data () and JQuery.data () is that JQuery.data , compared to .data () .
Comparing the code between the two, .data () is much usual .
See the difference:
$("div").data("test");
var div = $("div")[0];
jQuery.data(div,"test");