jQuery: Rotate images using a button
<p>I am  trying to rotate 2 images. For now, I have this code:</p>

<pre><code>$('img').on({
  'click': function () {
    var src = ($(this).attr('src') === 'img1_on.jpg') ? 'img2_on.jpg' : 'img1_on.jpg';
    $(this).attr('src', src);
  }
});
</code></pre>

<p>It works perfectly: when I click on an image, the other appears. What I would like to do is exactly the same, but using a button to rotate the images, and not click on the image itself.</p>
