jquery - Javascript : Change img src After some interval of time -


this question has answer here:

guys don't know how add interval of time in javascript. know how add time before changing src of image. code w3schools

document.getelementbyid("image").src = "http://www.w3schools.com/js/landscape.jpg";
<!doctype html>  <html>  <body>    <img id="image" src="http://www.w3schools.com/js/smiley.gif" width="160" height="120">    <p>the original image smiley.gif, script changed landscape.jpg</p>    </body>  </html>

jsfiddle

settimeout(function() {                        document.getelementbyid("image").setattribute("src", "http://www.w3schools.com/js/landscape.jpg");                    }, 5000);
<img id="image" src="http://www.w3schools.com/js/smiley.gif" width="160" height="120">    <p>the original image smiley.gif, script changed landscape.jpg</p>

i have updated fiddle


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -