What is the difference between .data () and JQuery.data ()?

3

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.

    
asked by anonymous 26.02.2016 / 23:22

1 answer

2

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");
    
30.03.2016 / 14:21