title: How can I get title attribute of clicked button?
body: <p>I'm working on small angular project, and there are 3 buttons on my form, I would like to receive their title when they are clicked. They are clicked normally one by one, what I've tried so far:</p>
  
  <p>Here is my html:</p>
  
  <pre><code>&lt;div class="extra-btns"&gt;
    &lt;button type="button" title="Title 1"  (click)="getMyTitleOne($event)" class="btn xbutton-square" style="font-size: 16px;"&gt;&lt;i class="fas fa-newspaper fa-fw"&gt;&lt;/i&gt;&lt;/button&gt;
    &lt;button type="button" title="Title 2" (click)="getMyTitleTwo($event)" class="btn xbutton-square"&gt;&lt;i class="fas fa-fw"&gt;&lt;/i&gt;&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My typescript code:</p>
  
  <pre><code>  getMyTitleOne($event) {
      console.log($event.target.title);
    }
  
    getMyTitleTwo($event) {
      console.log($event.target.title);
    }
  </code></pre>
  
  <p>But in my console sometimes I get values and sometimes I don't, very weird, but most of the time values are undefined:</p>
  
  <p><a href="https://i.stack.imgur.com/Kj5KO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kj5KO.png" alt="enter image description here"></a></p>
  
  <p>Thanks guys
  Cheers</p>