Change The Image Source Using JQuery




Here we consider how to Change The Image Source Using JQuery. Suppose we have an Image as shown below.

Change Image Source Path SRC Using JQuery, Change Image SRC Using JQuery, Change Image Source Path SRC In JQuery, Change Image SRC In JQuery, Image Source Path SRC In JQuery, Image SRC In JQuery, jquery Image SRC, Jquery Image Source Path, SRC, Jquery

On Button Click, we may wants to change the src of this Image. We can make use of Jquery attr for changing source path as follows.


$(function () {
          $('#btnSubmit').click(function () {
                    $(".imgClass").attr("src", "NewImageSrc.jpg");
                    return false;
          })
})



Here we first find the Image by using its Class. And then src attribute value will be changed with desired one by using Jquery attr. That's all, after button Click, the src of the Image will be changed.