1.0.4 • Published 5 years ago
hidenger v1.0.4
Hidenger
Show and hide input with one click
Easy code Vanilla & Pure Javascript
How To Install
npm i hidenger OR npm install hidenger
Things to pay attention
- Input only works with ID attribute
- The button must have a "data-relevant-input" attribute and this value must match the input's ID
Example HTML Structure And JavaScript Trigger
<div>
<input type="password" id="user-password">
<button type="button" id="user-password-manipulation" data-relevant-input="user-password">Show Password</button>
</div>
<div>
<input type="password" id="user-password2">
<button type="button" class="user-password-manipulation2" data-relevant-input="user-password2">Show Password</button>
</div>
Hidenger.trigger('#user-password-manipulation');
Hidenger.trigger('.user-password-manipulation2');
Thanks For Help
@selimdoyranli