Consider a markup such as
<select id="blah">
<option value="3">Some text</option>
<option value="4">Some text</option>
<option value="8">Some text</option> // <---- target this tag based on value 7
<option value="19">Some text</option>
</select>
Suppose I have a value with me, say 7. Is it possible to target the option tag whose value attribute is closest to 7 which, in this case, would be <option value="8">?
I’m aware of ^ which means starting with and $ which means ending with and was hoping if there is something like this to find the closest match for a given value.
I’ll go like this:
http://jsfiddle.net/GNNHy/