title: How to change title attribute in <a> tag using JavaScript?
body: <p>I have a html tag , in that initially I want tooltip name as mentioned in the "title" attribute. After I click on the link, I want different tooltip name. I have used the below code but it is not working. Can anyone please help me? </p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script&gt;
  
  function tool(){
  document.getElementsByName(link).title = "after click";
  }
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;a href="javascript:tool()" name ="link" title="before click"&gt;click here&lt;/a&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>