How to choose all the elements of INPUT with style="color: #F20808"?
<form>
<input type="text" value="1">
<input type="text" value="2" style="color: #F20808">
<input type="text" value="3" style="color: #F20808">
<input type="submit" value="submit">
</form>
$('form').submit(function(){
if($(this).find('input').css('color') != 'rgb(242, 8, 8)'){
return true;
}
return false;
});
This way works, but I dont like:
$('form').submit(function(){
if($(this).find('input:eq(1), input:eq(2)').css('color') != 'rgb(242, 8, 8)'){
return true;
}
return false;
});
Are there any other ways?