why we can't get object by value in jquery
javascript, jquery
Solution
Using the attribute selector, `[...]`, you're inspecting the attribute `value`, which is the value the input was given when created, not its actual value, which is a property of the input field.
You'd have to fall back to a filter:
$('.small')
.filter(function() { return this.value == 'X'; })
.css('border', '1px solid #F00');
Problem
I am trying to set red color for all input with `X` value and `small` class. but this code doesn't work. ``` $('.small[value="X"]').css('border','1px solid #F00'); ``` html ``` <input type="text" value="<?php echo trim($order['dns1']); ?>" class="wd-150 en small" /><br /> <input type="text" value="<?php echo trim($order['dns1']); ?>" class="wd-150 en small" /><br /> <input type="text" value="<?php echo trim($order['dns1']); ?>" class="wd-150 en small" /><br /> ``` is there any tip?