Skip to content

Instantly share code, notes, and snippets.

Created May 23, 2018
What would you like to do?
js запретить печатать кириллицу в input
function Latin(obj) {
if (/^[a-zA-Z0-9 ,.\-:"()]*?$/.test(obj.value))
obj.defaultValue = obj.value;
obj.value = obj.defaultValue;
<input onkeyup="Latin(this);">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment