title: how to create onclick for a link
body: <p>i have a <code>div</code> for which i set value dynamically during run time, if there is value than i have enable or create a link which will have <code>onclick</code> method where i will call a <code>javascript</code> method.</p>
  
  <p>how to do this in <code>jquery</code> or <code>javascript</code>?</p>
  
  <p>I set value to a <code>div</code> like the following,</p>
  
  <pre><code>document.getElementById('attachmentName').innerHTML=projectInforamtionMap.Cim_AttachmentNames;
  </code></pre>
  
  <p>this the div :</p>
  
  <pre><code>&lt;tr&gt;
    &lt;td align="left"&gt;&lt;div id="attachmentName"&gt; &lt;/div&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Kindly help me to find and fix.</p>
  
  <p>Best Regards</p>