how to detect which image is clicked in a list using only one click function in jquery
<p>I want to use only a one-click function to change the source path for the multiple images. each click should be specific to each image. For example: if I click on one image it should change the src path for that image only. Please help me with this. Here is the code:</p>
<pre><code>$(document).ready(function () {

  $('.n_daynite').click(function () {
    $('.n_daynite').attr('src', &quot;img/BM_DayNight_v.png&quot;);
  });

  $('.n_glamour').click(function () {
    $('.n_glamour').attr('src', &quot;img/BM_Glamour_v.png&quot;);
  });

  $('.n_GQ').click(function () {
    $('.n_GQ').attr('src', &quot;img/BM_GQ_v.png&quot;);
  });

  $('.n_Maxim').click(function () {
    $('.n_Maxim').attr('src', &quot;img/BM_Maxim_v.png&quot;);
  });

  $('.n_Popular').click(function () {
    $('.n_Popular').attr('src', &quot;img/BM_Popular_v.png&quot;);
  });

  $('.n_Preferred').click(function () {
    $('.n_Preferred').attr('src', &quot;img/BM_Preffered_v.png&quot;);
  });

  $('.n_TChad').click(function () {
    $('.n_TChad').attr('src', &quot;img/BM_TChad_v.png&quot;);
  });

});
</code></pre>