I have a dropdown list that contains a series of options:
<select id=SomeDropdown>
<option value="a'b]<p>">a'b]<p></option>
<option value="easy">easy</option>
<select>
Notice that the option value/text contains some nasty stuff:
- single quotes
- closing square bracket
- escaped html
I need to remove the a'b]<p> option but I'm having no luck writing the selector. Neither:
$("#SomeDropdown >option[value='a''b]<p>']");
or
$("#SomeDropdown >option[value='a'b]<p>']");
are returning the option.
What is the correct way to escape values when using the "value=" selector?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…