data value jquery code example
Example 1: jquery get data attribute value
<a data-id="123">link</a>
$(this).attr("data-id")
$(this).data("id")
Example 2: jquery data attribute
<a data-number="123">link</a>
$(this).attr("data-number")
$(this).data("number")
Example 3: jquery data
$( "body" ).data( "foo", 52 );
$( "body" ).data( "bar", { isManual: true } );
$( "body" ).data( { baz: [ 1, 2, 3 ] } );
$( "body" ).data( "foo" );
$( "body" ).data();
Example 4: jquery get data attribute
<a data-id="123">link</a>
var id = $(this).data("id");