Version 0.3.0
Generate a simple HTML Captcha in your form with single line of code.
- Super lightweight, less then 10KB
- No frameworks. No libraries.
- Minimal and ease to use
@louisho5
To include the plugin in your code:
<script src="htmlCaptcha.js"></script>
or
<script src="htmlCaptcha.min.js"></script>
Works in Edge 12+, Chrome 29+, Safari 9+, Firefox 28+.
index.html:
<form>
<div id="captcha"></div>
</form>
<script src="htmlCaptcha.min.js"></script>
<script>
new htmlCaptcha({
target: '#captcha'
});
</script>
There are 2 parameters in this plugin:
new htmlCaptcha({
target: '#captcha', // Required
placeholder: 'Enter valid code', // Optional
debug: true // Optional, Will log the validation code in console
});
It is possible to override the CSS for all items:
.html-captcha-canvas {
border: none !important;
}
.html-captcha-refresh {
border-radius: 0 !important;
}
.html-captcha-input {
color: red !important;
}
This plugin is under the MIT license.