The NinjaMaskMoney plugin adds a money mask component into a input text element.
NinjaMaskMoney
References
Add those references into your website:
And the plugin files:
Call ninjaMaskMoney method to initialize the plugin:
$(document).ready(function(){
$("#myMask").ninjaMaskMoney();
});
Options
.ninjaMaskMoney({
thousands: ',',
decimal: '.',
precision: 2,
allowZero: true,
allowNegative: false
onBlur: null //-- set a function to be fired when the focus leave the input
);
Methods
Name |
Description |
Sample |
|---|---|---|
ninjaMaskMoney(mask, {options}) |
Initialize the plugin to the specified selector. |
$("#myMask").ninjaMaskMoney({precision:2}); |