Question: i have html 

```
<a href="#" data-ext="sql" rel="\dir\file.sql" id="file">file.sql</a>

```

And i want find this `a#file` among others by `rel`, so 

```
$("#file[rel='\dir\file.sql']")

```

not works, because `\` removing (why?)

```
var some_var = "/s/s/s/\a\a\a";
// undefined
some_var
// "/s/s/s/aaa"

```

So, how i can select item(items) by rel with `\` in it? 

And this is not all want to work

```
$("#file[rel='\\dir\\file.sql']")
$("#file[rel='/\dir/\file.sql']")  // ^^

```

Example <http://jsfiddle.net/fUNLV/1/> not works :(

Answer: 
The backslash is an escape character. To escape the escape character, you can double it up:

Edit - In this case, the escaping needs to be double-escaped:

<http://jsfiddle.net/FSqZe/>

```
var $el = $('#file[rel="\\\\dir\\\\file.sql"]');

```
You need to escape both slashes, not just 1.

```
$("#file[rel='\\\\dir\\\\file.sql']") // that's 4 slashes in each case, 8 total

```

<http://jsfiddle.net/Tentonaxe/fUNLV/2/>

This is because First, this string is passed to jQuery, at which point it would become 

```
"#file[rel='\\dir\\file.sql']"

```

then when it gets passed again internally to `document.querySelectorAll()`, the slashes are correctly escaped for the css selector engine.

<http://jsfiddle.net/Tentonaxe/fUNLV/4/>