I have modified a function to meet my need. This is what I have written to restrict multiple repetition of dots:
$('#title').val(){
replace(/\.{2,}/g, '.');
});
Is it correct? How can I make this in function so I can call with every element of the form?
1. Here is your code turned into a jQuery function/plugin.
2. Here is how you use it
3. Here is the demo