I have a dropdown like this ->
<div class="dropdown-item d-flex align-items-center" id="Emp1" onclick="">
<div class="mr-3">
<div class="icon-circle bg-success">
<img class="rounded-circle" src="{% static 'administrator/images/undraw_profile_1.svg' %}" alt="">
</div>
</div>
<div>
<div class="small text-gray-500">Johanthanc</div>
<span class="font-weight-bold" id="employee1">Mr. Johanthan Cristofer</span>
</div>
</div>
<div class="dropdown-item d-flex align-items-center" id="Emp2">
<div class="mr-3">
<div class="icon-circle bg-success">
<img class="rounded-circle" src="{% static 'administrator/images/undraw_profile_1.svg' %}" alt="">
</div>
</div>
<div>
<div class="small text-gray-500">Johanthanc</div>
<span class="font-weight-bold" id="employee2">Mr. Johanthan Cristofer</span>
</div>
</div>
Whenever I click on first div(for say div of id="Emp1"), name of employee should be set in a variable (i.e. div of id="employee1").
<script>
var employee;
jQuery(document).on("click", "#Emp1", function (event) {
employee = jQuery(this).attr('id') || '';
console.log(employee);
});
I want to pass the id of its nested division in the 3rd statement of script. So, what should I write to assign a value in employee variable (3rd statement) --> employee = jquery(this).... ???
