All the examples and use cases seem to be on how to use the plugin to apply a mask to the value of an input field. However, I've run into a situation where I need to apply the mask to a raw string value and get the resulting mask.
This finds the value of each element with the .phoneMask class and applies the mask on load and on keypress.
however, let say i have a random string "1231231234" This value is not the value of an input element but just the value of some variable in my code. How can i apply my custom mask just to this value so that i would end up with (123) 123-1234
All the examples and use cases seem to be on how to use the plugin to apply a mask to the value of an input field. However, I've run into a situation where I need to apply the mask to a raw string value and get the resulting mask.
for example I currently have this custom mask
This finds the value of each element with the .phoneMask class and applies the mask on load and on keypress.
however, let say i have a random string "1231231234" This value is not the value of an input element but just the value of some variable in my code. How can i apply my custom mask just to this value so that i would end up with (123) 123-1234