Change Image SRC Using JQuery
Often, we want to change image on-the-fly, without reloading the page. One common way to do this is using JQuery, changing source attribute of the image. Suppose we have an image:
<img class="pic" src="path/to/my/image.jpg" />
To change image source using JQuery do this:
It is done like changing any other attribute of an HTML element.
Share this story:
One response to “Change Image SRC Using JQuery”
Leave a Reply