use the double backslashes:
jQuery("#someform\\:somepanel\\:somebutton")
Related:
Update #1
After your comment in regards to auto escaping the best method I see is to create a function within the string object like so
String.prototype.escape = function()
{
return this.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/])/g,'\\$1')
}
you can also specifically define a function for the colons like so:
String.prototype.escape_colon = function()
{
return this.replace(/:/,'\\$1')
}
and use like so:
jQuery("someform:somepanel:somebutton".escape())
but this will cause issues on pseudo selectors such as:
jQuery("someform:somepanel:somebutton:first".escape())
the :first
selector will be escaped and therefore you will not find your element.
but y our best bet will be to build a string parser within the prototype to replace where it finds a specific set of chars such as:
jQuery("someform(_e(:))somepanel(_e(:))somebutton:first".escape())
this way you can define what you want to escape, but if that was the case you may as well escape them yourself.