title: How to get title of onclick button inside javascript function once it is clicked?
body: <p>I got few onclick buttons inside li . I wonder how I can get the title of each button inside JavaScript function once it is clicked ?I want to set the title of button equal to a variable.Thanks in advance.</p>
  
  <pre><code>&lt;javascript&gt;
      function MyFunction(MyFile,MyImage){
  
      //here i want to get the title of onclick button which is Mango and set it equal to variable.
  
      }
      &lt;/javascript&gt;
  
      &lt;li&gt;&lt;a id="123456" onclick="setCurrentID('123456');javascript:MyFunction('type=fruit&amp;day=friday','http://somesite.com/Image1.png');"&gt;Mango&lt;/a&gt;&lt;img src="http://www.somesite.com/123456.png"&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a id="123457" onclick="setCurrentID('123457');javascript:MyFunction('type=fruit&amp;day=friday','http://somesite.com/Image2.png');"&gt;Apple&lt;/a&gt;&lt;img src="http://www.somesite.com/123457.png"&gt;&lt;/li&gt;
  </code></pre>