javascript - jQuery - How to check if input contains only cyrillic letters -
i don't know how can check if input specific id contains cyrillic letters in it.
i want simple jquery function check input cyrillic letters , when there cyrillic letters give alert everything cool :d
, when there not cyrillic letters give alert we've got problem houston!
.
this simple example of want function.
can please me out ?
thanks in advance!
you can use regexp like:
/[а-яА-Я]/
here example:
var str1 = "Привет"; var str2 = "hello"; var patt = /[а-яА-Я]/g; console.log( patt.test(str1) ); // log true console.log( patt.test(str2) ); // log false
Comments
Post a Comment