Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select id=SomeDropdown>
- <option value="a'b]<p>">a'b]<p></option>
- <option value="easy">easy</option>
- <select>
- $("#SomeDropdown >option[value='a''b]<p>']");
- $("#SomeDropdown >option[value='a'b]<p>']");
- #SomeDropdown >option[value='a'b]<p>']
- $("#SomeDropdown >option[value='a\'b]<p>']")
- (['"]*)(.*?)3|)s*]
- var select= document.getElementById('SomeDropdown');
- for (var i= select.options.length; i-->0;) {
- if (select.options[i].value=="a'b]<p>") {
- // do something with option
- } }
- str.replace(/([ !"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g,'\\$1')
- var select= document.getElementById('SomeDropdown');
- for (var i= select.options.length; i-->0;) {
- if (select.options[i].value=="a'b]<p>") {
- alert('found it');
- }
- }
- var select= document.getElementById('SomeDropdown');
- for (var i= select.options.length; i-->0;) {
- if (select.options[i].value=="a'b]<p>") {
- alert('found it');
- }
- }
- function html_entity_decode(str) {
- var decoder = document.createElement('textarea');
- decoder.innerHTML = str;
- return decoder.value;
- }
- var srcValue = html_entity_decode("a'b]<p>");
- var select= document.getElementById('SomeDropdown');
- for (var i= select.options.length; i-->0;) {
- if (select.options[i].value == srcValue) {
- alert('found it');
- }
- }
- var srcValue = html_entity_decode("a'b]<p>");
- $($('#SomeDropdown').attr('options')).each(function(){
- if (this.value == srcValue)
- {
- $(this).remove();
- }
- });
- jQuery.fn.removeByValue = function( val )
- {
- var decoder = document.createElement('textarea');
- decoder.innerHTML = val;
- var srcValue = decoder.value;
- $( $(this)[0].options ).each(function(){
- if (this.value == srcValue){
- $(this).remove();
- }
- });
- return this;
- };
- $('#SomeDropdown').removeByValue("a'b]<p>");
Add Comment
Please, Sign In to add comment