title: HTML/Javascript use src string in onclick without retyping?
body: <p>I want to use the same string in my img "src" in my "onclick" as a parameter to a function. What's the easiest way to do this? It works fine if I type it out both times but it doesn't look nice.</p>
  
  <p>Here is an example so you can see what I mean...</p>
  
  <pre><code>&lt;img src="/images/image1.jpg" onclick="doStuff('/images/image1.jpg')"/&gt;
  </code></pre>
  
  <p>I'm wondering if there is a simple way to have the src in the onclick too that doesn't require me to write it out again? So I can use a general onclick for each image that needs to be clicked.</p>