jquery - Find each img src in document body -


i want find each image on page , replace image

i attempting following piece of jquery.

$('img').each(function() {     $(this).attr("src", "http://myurl.com/mypic.jpg"); } 

however not updating of images on page? there have missed?

in code haven't finished function closing ). try:

$("img").each(function () {     $(this).attr("src", "http://myurl.com/mypic.jpg"); }); 

or simplify:

$("img").attr("src", "http://myurl.com/mypic.jpg"); 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -