Answer the question
In order to leave comments, you need to log in
Why does replace javascript work crookedly?
Somehow replace works strangely, I need to prohibit the input of certain characters, and if it works at the beginning of the line, then it stops
Code: https://jsfiddle.net/sL5mqudn/1/
Answer the question
In order to leave comments, you need to log in
You are only replacing the first character. You could add the /g modifier and remove the characters from the beginning and end of the line
/[а-я, 0-9]/g
But in general, it is better to do such things through preventDefault()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question