get the data attribute using the id javascript code example Example: data id tag var dataId = $(this).attr("data-id");