I have an element with id=\"A B\". The following code fails:
As they mentioned you shouldn't use spaces in id. But anyway, wouldn't this be working for you?
$("[id='A B']").click(...)
EDIT: yes it works, tested it!!! Don't kill me, standard-lovers!! ;-P