I am trying to get the clicked element using the property relatedTarget
of the show.bs.modal
event. It's always getting undefined though.
This is what I have:
$("#curCarSelect").on('click', function(e) {
$("#curCarModal").on('show.bs.modal', function(event) {
modalOpenedby = event.relatedTarget;
alert(modalOpenedby);
}).modal('toggle');
});