Im trying to write a function that will convert all charactewrs after the first word into asterisks,
Say I have MYFIRSTWORD MYSECONDWORD, id want it to convert to asterisks on Keyup, but only for the second word, rendering it as so…
MYFIRSTWORD ***
I’ve been using the following only it converts each and every letter, is this possible?
$(this).val($(this).val().replace(/[^\s]/g, "*"));
I’m not sure about doing it with a single regex, but you can do this:
Demo: http://jsfiddle.net/fc7ru/