Problem with .find and attribute selector when attribute have escaped special character

Problem with .find and attribute selector when attribute have escaped special character

Test Case:

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.   <script src="http://code.jquery.com/jquery-latest.js"></script>
  5. </head>
  6. <body>
  7. <div id="MyDiv">
  8.   <input name="NS$MYFIELD" />
  9. </div>
  10. <script>
  11.     var x = jQuery("#MyDiv");
  12.     alert(jQuery("input[name=NS\\$MYFIELD]").length) //1;
  13.     alert(x.find("input[name=NS\\$MYFIELD]").length) //0;
  14. </script>
  15. </body>
  16. </html>

Firebugging it:
Stack: find() > Sizzle() > Sizzle() > filter() > ATTR()

3284 return result == null ?
3285         type === "!=" :
3286         type === "=" ?
3287         value === check :
3288         type === "*=" ?
3289         value.indexOf(check) >= 0 :
3290         type === "~=" ?
3291         (" " + value + " ").indexOf(check) >= 0 :
3292         !check ?
3293         value && result !== false :
3294         type === "!=" ?
3295         value !== check :
3296         type === "^=" ?
3297         value.indexOf(check) === 0 :
3298         type === "$=" ?
3299         value.substr(value.length - check.length) === check :
3300         type === "|=" ?
3301         value === check || value.substr(0, check.length + 1) === check + "-" :
3302         false;



















check != value as check has escaped $ character