I'm trying, using Konvas.js, to click on imgback class and change the background according to the clicked image:
https://jsfiddle.net/hk7xe0we/3/
I do not want to put an id on each image
Following code:
Jquery:
$('.back').click(function(){
imgback = $('img').attr('src');
});
Html
<h2>Background</h2>
<span class="back"><img class="img-responsive img-thumbnail" src="http://lorempixel.com/450/400/animals" width="50px"></span>
<span class="back"><img class="img-responsive img-thumbnail" src="http://lorempixel.com/400/400/city" width="50px" ></span>
Thanks for any help