Is it possible to use a CSS selector to target an input that has a specific value?
Example: How can I target the input below based on the value="United States"
<input type="text" value="United States" />
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Dynamic Values (oh no! D;)
As npup explains in his answer, a simple css rule will only target the attribute
valuewhich means that this doesn’t cover the actual value of the html node.JAVASCRIPT TO THE RESCUE!
Original Answer
Yes it’s very possible, using css attribute selectors you can reference input’s by their value in this sort of fashion:
• jsFiddle example