Answer the question
In order to leave comments, you need to log in
How to implement search through jquery by integer?
Hey!
There was a big problem. I've always done a search like this:
var search = $.trim($('input').val()),
reg = new RegExp(search, 'i');
$.each(search_data, function(key,val) {
if (val.name.search(reg) != -1 || val.code.search(reg) != -1) {
data[key] = {
"name" : val.name,
"code" : val.code
};
}
});
Uncaught TypeError: val.code.search is not a function
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question