I am trying to import images from a folder on my server strictly using JavaScript so that I can switch it out with a new image on button click. I know how to import photos using HTML, but is there a way to do it through JavaScript? What is the best way to do this? Any help, guidance or examples would be greatly appreciated.
Share
You can embed an image within a dom element on your page. Here is a really simple example html file which does this assuming the
myimage.jpgfile is in the same directory. Check out w3schools for more info on javascript.