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