Create new URL based on existing URL - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Image

Description

Create new URL based on existing URL

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;//  w  ww  .  j  av  a2  s  . c o m
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