Displaying new image or reloading image by click of a button using JavaScript. Check that we are not reloading the full page, we are only reloading the image. img.src="captcha-demo.php?rand_number=" + Math.random(); }

Grab the source code and learn how to load content into a div on click using the AJAX load method. Load a Page With AJAX and No Refresh.