Reputation: 398
I want check if text is non-english charachter , i wrote this code but unfortunately not working:
var objsts = $('a');
var english = /^[A-Za-z0-9]*$/;
$.each(objsts, function () {
var $this = $(this);
if (!$this.html() == english)
$this.addClass('active');
});
any solution?
Upvotes: 1
Views: 2619
Reputation: 388316
Since english is a regex use the test()
method
if (!english.test($this.html()))
Upvotes: 1