jquery for loop on click image swap
- by user2939914
I've created a for loop of images. I would like each image to swap with another image on click individually. Here's the jQuery I've written so far:
for ( var i = 1; i < 50; i++) {
$('article').append('<div class="ps-block" id="' + i + '"><img src="img/bw/' + i + 'bw.png"></div>');
}
$('img').click(function() {
var imgid…