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