title: JS events source detection
body: <p>I'm working on a part of my web site where people can vote on publications, I have many in the same page, and next every publication there are two images one to agree and the other to disagree. I want to change the images, so when someone votes, whether agree or not, the image changes to say he already voted.
  Here's my code:</p>
  
  <p>JPS:</p>
  
  <pre><code>&lt;logic:iterate id="comment" name="Liste_Comments" scope="request"&gt;   
  &lt;html:img  src="pages/images/ok.png" alt="Vote pour!" paramId="code" paramName="comment"   paramProperty="code" onclick="voterComment('pour');"/&gt; 
  
  &lt;html:img  src="pages/images/ko.png" alt="Vote contre!" paramId="code" paramName="comment"  paramProperty="code" onclick="voterComment('contre');"/&gt;       
  
         &lt;bean:write name="comment" property="libelle" /&gt;       
         &lt;bean:write name="comment" property="subject" /&gt; 
         &lt;br&gt;       
  &lt;/logic:iterate&gt;
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
              function voterComment(vote) {            
                  var url = "&lt;%=request.getContextPath()%&gt;/VoteComment.do";
                  new Ajax.Request(url, {
                      parameters: {vote: vote},
                      onSuccess: function(transport, json) {
                          if (json.error) {
                              alert(json.error);
                          }
                          else{
                              window.event.srcElement.src = "pages/images/photo.jpg";
                          }
                      }
                  });
              }
     &lt;/script&gt;
  </code></pre>
  
  <p>I have a problem to access to the image that was clicked!!</p>
  
  <p>Thanks guys, in advance, for your great helping :)</p>