Jquery Simple Captcha Example - Jquery

How to create a simple captcha in jquery?

Snippet Code


  
Rate this page :
  [ 0 votes]

Captcha is used protect your website from spammers for example online account openings, creating a mail id etc. Implementing captcha using jquery brings more efficient way to identify spambots. The sample code to create sample captcha using jquery is given below.

<script src='http://code.jquery.com/jquery-2.1.0.min.js'></script> <div id="captcha-wrap"> <div class="captcha-box"> <img src="http://demos.99points.info/recaptcha_like_captcha/get_captcha.php" alt="" id="captcha" /> </div> <div class="captcha-action"> <img src="http://demos.99points.info/recaptcha_like_captcha/refresh.jpg" alt="" id="refresh" /> </div> </div> <script> $(document).ready(function() { $('img#refresh').click(function() { change_captcha(); }); function change_captcha() { document.getElementById('captcha').src="http://demos.99points.info/recaptcha_like_captcha/get_captcha.php?rnd=" + Math.random(); } }); </script>

Tags


Ask Questions

Ask Question