I have problem for replace whitespace by «-» in no working. Why?
But ein type="text" is working
My Code HTML is simple:
<input type="text" class="demo" placeholder="type=text" /><br /><br />
<input type="email" class="demo" placeholder="type=email" />
My Code jQuery:
$(document).on("keyup",".demo",function(e) {
$(this).val($(this).val().replace(/\s+$/g, "-"));
});
My jsFiddle:
https://jsfiddle.net/6qo973vm/11/
Solutions?