$('input[value="test"]') Should work fine…
EDIT
You could try using if statements, for example:
$("input").keyup(function(e) {
if (this.value == 'foo'){
$(this).css('backgroundColor','red');
}
else if (this.value == 'bar'){
$(this).css('backgroundColor','green');
}
else $(this).css('backgroundColor','white');
});
http://jsfiddle.net/ajthomascouk/HrXVS/