Refresh Captcha Image - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Image


Refresh Captcha Image

Demo Code

ResultView the demo in separate window

      <img src="http://your captcha_image.php" id="captcha_img"> 
      <a href="javascript:refresh_captcha()">Reload the image</a> 
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;

Related Tutorials