To replace a specific Character from String with other character or number in Jquery we have to use regular expression.
Lets See
How?
var data="pqrst$vw"
Here we have string data in which we have to replace "$" with Character "u"
So to do that
we will write
var replaceddata = data.replace(/$/g, 'u')
So in return we will get
replaceddata="pqrstuv"
Conclusion
Basically we use replace in jquery to stop passing any other unwanted input from keyboard or to filter the data with correct digit or character.
Lets See
How?
var data="pqrst$vw"
Here we have string data in which we have to replace "$" with Character "u"
So to do that
we will write
var replaceddata = data.replace(/$/g, 'u')
So in return we will get
replaceddata="pqrstuv"
Conclusion
Basically we use replace in jquery to stop passing any other unwanted input from keyboard or to filter the data with correct digit or character.