title: jquery adding an onclick event to a href link
body: <p>i am converting over from websforms to asp.net mvc and i have a question.</p>
  
  <p>i have a loop that generates links dynamicallly where picNumberLink is a variable in a loop and image is a variable image link.</p>
  
  <p></p>
  
  <p>i want to avoid putting javascript actions inline so in my webforms project is did the following:</p>
  
  <pre><code>hyperLink.Attributes.Add("onclick", "javascript:void(viewer.show(" + picNumberlink + "))");
  </code></pre>
  
  <p>what is the equivalent using jquery in asp.net mvc?</p>
  
  <p>I have seen examples of using the $(document).ready event to attach on clicks but i can't figure out the syntax to pass in the picNumberLink variable into the javascript function.</p>
  
  <p>suggestions?</p>