title: Return the attribute id from the element that triggered the event
body: <p>I have an element, this element calls the function calcTotal via the following code:</p>
  
  <pre><code>$('.pause').change(function(e) {
      window.alert("pause changed");
      calcTotal(e);
  </code></pre>
  
  <p>The code of calcTotal(e) is as follows:</p>
  
  <pre><code>function calcTotal(event)
  {   alert('calcTotal called');
      var myId = event.currentTarget.attr('id');
  
      myId = myId.replace(/[^0-9]/g, '');
  
      var timeRegex = /^[0-9]{1,2}:[0-9]{2}$/;
  
      if($('#start'+myId).val().match(timeRegex) &amp;&amp; $('#end'+myId).val().match(timeRegex) &amp;&amp; $('#pause'+myId).val().match(timeRegex))
      {
          var minutes = 0;
  
          var n = $('#end'+myId).val().split(':');
          minutes = parseInt(n[0])*60 + parseInt(n[1]);
  
          var n = $('#start'+myId).val().split(':');
          minutes -= parseInt(n[0])*60 + parseInt(n[1]);
  
          var n = $('#pause'+myId).val().split(':');
          minutes -= parseInt(n[0])*60 + parseInt(n[1]);
  
          var hours = Math.floor(minutes/60);
          minutes = minutes % 60;
          alert(hours + ':' + minutes);
          $('#total' + myId).val(hours + ':' + minutes);
      }
      else
      {       
          $('#total' + myId).val('00:00');
      }
  
  }   
  </code></pre>
  
  <p>It doesn't work as I had exceptected and when I debug with firebug it says the following:</p>
  
  <pre><code>TypeError: event.currentTarget.attr is not a function
  var myId = event.currentTarget.attr('id');  
  </code></pre>
  
  <p>I would like to store the id of the element in myId.
  How would I do this?</p>