-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to Integrate jQuery Mask Plugin with React.js? #498
Comments
not work fiidle |
@rinatsafin You can refer to my new example https://jsfiddle.net/nhduy88/20s9ubrv/ |
Hello, to use with React, i need to install this plugin and jquery too ? |
Definitely yes, It is jQuery plugin. |
Yes, Need install and import jQuery as $ and need to import the code on top of the file, like this: import $ from 'jquery';
import 'jquery-mask-plugin/dist/jquery.mask.min'; Theeennn... You can use it: $('.dinheiro').mask('#.##0,00', {
reverse: true,
placeholder: '0,00'
}); I am clarifying this because I didn't find anyone saying nothing. And just adding the script into header tag doesn't work. |
так же почему то не работает если прописать в input data-mask="..." |
NPM:
Bower:
Meteor:
Composer:
import $ from 'jquery';
import 'jquery-mask-plugin';
const Component = () => {
$(() => {
$('#date').mask('00/00/0000');
});
return (
<form onSubmit = { e => e.preventDefault() }>
<input
type = 'text'
id = 'date'
placeholder = '00/00/0000'
/>
</form>
);
}
export default Component; |
I've made a simple jsfiddle showing how to integrate jQuery Mask with React.js:
https://jsfiddle.net/igorescobar/47ubm7az/
The text was updated successfully, but these errors were encountered: