ajjya-custom-form
v1.0.4
Published
Pure javascript input stylerinput styler
Downloads
4
Maintainers
Readme
Custom-form
Javascript custom select, checkbox, radiobox, input['file']
Installation
- Download the latest release
- Clone the repository: git clone Clone
In the head tag add:
<link href="path-to-library/style.min.css" rel="stylesheet">
Before your closing body tag add:
<script type="text/javascript" src="path-to-library/polyfill.min.js"></script>
<script type="text/javascript" src="path-to-library/customForm.js"></script>
Or by npm/yarn
yarn add ajjya-custom-form
OR
npm install ajjya-custom-form
Then you can import:
import CustomForm from 'ajjya-custom-form';
And add css file:
@import 'node_modules/ajjya-custom-form/style.min.css';
Or scss file
@import 'node_modules/ajjya-custom-form/customForm';
Usage
Then you can use library in next way:
document.addEventListener('DOMContentLoaded', function () {
const checkboxes = document.querySelectorAll('input[type="radio"]');
checkboxes.forEach((item) => {
new CustomForm(item);
});
});
You can see full code in example folder.