title: Passing "this" and "event" in JS function
body: <p>I have a button with an onclick event as follows:</p>
  
  <pre><code>&lt;button type="button" onclick="captions(event)"&gt;
       &lt;img src="someimg.png"&gt;
  &lt;/button&gt;
  </code></pre>
  
  <p>I need to be able to change the img src without using an ID to reference it.  I want to pass "this" and the event (I need to do some other things that require event to be passed) but I cannot get this to work.  Example of JS is below:</p>
  
  <pre><code>function captions(event) {
               this.src = this.src.replace("img2.png");
  }
  </code></pre>
  
  <p>Thanks!</p>