I have a <select>
menu with a bunch of <option>
tags, all populated from a database table.
I need to use a jquery selector such as $('option[value=d&c]')
in order to find an option such as this one:
<option value="d&c">d&c</option>
Note that the value
attribute does not have an encoded ampersand (&
) in it, just a straight ampersand (&
) because of how Zend Framework populates it.
Only problem is that jQuery chokes with the following error:
uncaught exception: Syntax error, unrecognized expression: [value=d&c]
It also won't accept $('option[value=d&c]')
. It's the ampersand messing it up, in either case. Does anyone know how to get around this limitation?