jquery get data attribute of clicked element code example
Example 1: jquery get data attribute value
/* html */
link
/* js */
$(this).attr("data-id") // returns string "123"
$(this).data("id") // returns number 123 (jQuery >= 1.4.3 only)
Example 2: data id tag
var dataId = $(this).attr("data-id");