Select element with percent sign (%) in its id with jQuery

Viewed 3589

I have an element like this:

<a id="my%20id" href="#">hello</a>

I've been trying desperately to select it with jQuery, but cannot. I've tried:

$('a#my id')                          // obviously won't work
$('a#my\ id')                         // no such luck
$('a#my%20id')                        // unrecognized expression
$('a#my\%20id')                       // still unrecognized
$('a#' + encodeURIComponent('my id')) // same thing as 'a#my%20id'

Is it possible to select this at all with jQuery?

3 Answers
Related