Javascript examples for jQuery:Image
Change the value of the image's src attribute
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("img").attr("src", "http://java2s.com/resources/a.png"); });//from w w w. j a va 2 s. c o m </script> </head> <body> <img id="image" src="http://java2s.com/resources/b.png" width="284" height="213"> </body> </html>