Guest User

Untitled

a guest
Jun 23rd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. <select id=SomeDropdown>
  2. <option value="a'b]<p>">a'b]<p></option>
  3. <option value="easy">easy</option>
  4. <select>
  5.  
  6. $("#SomeDropdown >option[value='a''b]<p>']");
  7.  
  8. $("#SomeDropdown >option[value='a'b]<p>']");
  9.  
  10. #SomeDropdown >option[value='a'b]<p>']
  11.  
  12. $("#SomeDropdown >option[value='a\'b]<p>']")
  13.  
  14. (['"]*)(.*?)3|)s*]
  15.  
  16. var select= document.getElementById('SomeDropdown');
  17. for (var i= select.options.length; i-->0;) {
  18. if (select.options[i].value=="a'b]<p>") {
  19. // do something with option
  20. } }
  21.  
  22. str.replace(&#47;(&#91; !"#$%&&#39;()*+,.&#47;:;<=>?@&#91;\&#93;^`{|}~&#93;)&#47;g,&#39;\\$1&#39;)
  23.  
  24. var select= document.getElementById('SomeDropdown');
  25. for (var i= select.options.length; i-->0;) {
  26. if (select.options[i].value=="a'b]<p>") {
  27. alert('found it');
  28. }
  29. }
  30.  
  31. var select= document.getElementById('SomeDropdown');
  32. for (var i= select.options.length; i-->0;) {
  33. if (select.options[i].value=="a'b]<p>") {
  34. alert('found it');
  35. }
  36. }
  37.  
  38. function html_entity_decode(str) {
  39. var decoder = document.createElement('textarea');
  40. decoder.innerHTML = str;
  41. return decoder.value;
  42. }
  43.  
  44. var srcValue = html_entity_decode("a'b]<p>");
  45. var select= document.getElementById('SomeDropdown');
  46. for (var i= select.options.length; i-->0;) {
  47. if (select.options[i].value == srcValue) {
  48. alert('found it');
  49. }
  50. }
  51.  
  52. var srcValue = html_entity_decode("a'b]<p>");
  53. $($('#SomeDropdown').attr('options')).each(function(){
  54. if (this.value == srcValue)
  55. {
  56. $(this).remove();
  57. }
  58. });
  59.  
  60. jQuery.fn.removeByValue = function( val )
  61. {
  62. var decoder = document.createElement('textarea');
  63. decoder.innerHTML = val;
  64. var srcValue = decoder.value;
  65.  
  66. $( $(this)[0].options ).each(function(){
  67. if (this.value == srcValue){
  68. $(this).remove();
  69. }
  70. });
  71.  
  72. return this;
  73. };
  74.  
  75. $('#SomeDropdown').removeByValue("a'b]<p>");
Add Comment
Please, Sign In to add comment