I have code as follows:
<div id="make" data-make-unique-id="{{ values.unique_id }}">
<div class="d-flex flew-row align-items-center">
<i class="icon-{{ key|lower }}" style="font-size: 19px;"></i>
<div class="text-capitalize">{{ key|lower }}</div>
</div>
<div class="d-flex align-items-center">{{ values.counter }}</div>
</div>
I want to capture click event on the div with id make
. And I want to get data-make-unique-id
tag value, no matter if is clicked on the div with id make or on some of the children.
I tried something as follows:
$(document).on('click', '#make', (e) => {
const unique_id = $(this).data("make-unique-id");
debugger;
});
But if it doesn't work.