Skip to content

Commit 50ed4a7

Browse files
qnet-herwinajpiano
authored andcommitted
Add brackets to helper for automatically escaping selector string in FAQ. Fixes jquery#224.
1 parent 34ca6ab commit 50ed4a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

page/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The following function takes care of escaping these characters and places a "#"
2626
```
2727
function jq( myid ) {
2828
29-
return "#" + myid.replace( /(:|\.)/g, "\\$1" );
29+
return "#" + myid.replace( /(:|\.|\[|\])/g, "\\$1" );
3030
3131
}
3232
```
@@ -35,4 +35,4 @@ The function can be used like so:
3535

3636
```
3737
$( jq("some.id") )
38-
```
38+
```

0 commit comments

Comments
 (0)