Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
You can also do this with jQuery in this way:
$(".c1 img").click(function(){ $(this).attr(src=''src','/new/image/src.jpg'); });
You can have a condition if there are multiple states for the image source.
$(".c1 img").click(function(){ $(this).attr(src='/new/image/src.jpg'); });
$(".c1 img").click(function(){ $(this).attr('src','/new/image/src.jpg'); });
You can also do this too with JQueryjQuery in this way:
Take care you all.
You can do this too with JQuery this way: