Skip to content

louisho5/htmlCaptcha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML Captcha

Version 0.3.0

Summary

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

Author

@louisho5

Installation

To include the plugin in your code:

<script src="htmlCaptcha.js"></script>

or

<script src="htmlCaptcha.min.js"></script>
	

Requirements/Browsers

Works in Edge 12+, Chrome 29+, Safari 9+, Firefox 28+.

Code Example

index.html:

<form>
    <div id="captcha"></div>
</form>

<script src="htmlCaptcha.min.js"></script>
<script>
    new htmlCaptcha({
        target: '#captcha'
    });
</script>

Parameters

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
});

Styling

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;
}

License

This plugin is under the MIT license.

Releases

No releases published

Packages

No packages published