





Code
$( document ).ready(function() {
$(".myImage").on("click",function()){
var sourceimg=$('img[class="myImage"]').attr('src')
$('img[class="defaultimg"]').attr('src',sourceimg);
Code
});
});1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsForums
Top experts
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Jul 26, 2022, 2:12 AM EDT