Reputation: 24676
I need to get all values from a set of input text in my page and I need to know if someone of these inputs has value 'some value'
I'm using JQuery so I'm doing something like:
$('input.partValue').each(function(){
int count = 0;
if($(this).val() == 'some value'){
count++;
}
});
if(count > 0){
// do something
}
but could be useful to have something like:
if($("input.partValue[value='some value']").length > 0){
// do something
}
There is something similar?
Upvotes: 1
Views: 52