Refresh Captcha Image - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Image

Description

Refresh Captcha Image

Demo Code

ResultView the demo in separate window

<html>
   <head></head>
   <body> 
      <img src="http://your captcha_image.php" id="captcha_img"> 
      <a href="javascript:refresh_captcha()">Reload the image</a> 
      <script>
refr_no = 0;/*from   w w  w. j  a  v  a2  s.c  om*/
function refresh_captcha()
{
   im = document.getElementById('captcha_img');
   refr_no = refr_no + 1;
   im.src = "http://your captcha_image.php?" + refr_no;
}
  
      </script>  
   </body>
</html>

Related Tutorials