I have to implement masking for a field through javascript and i have written a code and its working fine with alphanumeric characters or word but the below code is not able to mask the special character entered.
function addMask(value) {
$(this).val(value.replace(/\w(?=\w{4})/g, "*"));
}
its not able to mask the special characters.