Hi, look here at the bottom: http://docs.jquery.com/Selectors
you may try something like this: var id = 'sec_ruler_widget_seclevel\\[' + checkElementId + '\\]'; var pic = $('#' + id)[0]; On 29 Sep., 15:03, Misha <[EMAIL PROTECTED]> wrote: > Hi, > > I am a newbie here so maybe my problem is not problem at all, but here > is problem what i just got. I want to select an image element by its > id and this id is quite complicated (do not ask me why). Here is the > jQuery code for that: > > var id = 'sec_ruler_widget_seclevel[' + checkElementId + ']'; > var pic = $('#' + id)[0]; > > ...and it does not work. I am getting an empty array back. After that > i tried a goog old getElementById() Function and it found an image i > wanted: > > var id = 'sec_ruler_widget_seclevel[' + checkElementId + ']'; > var pic = document.getElementById(id); > > Has anyone got a similar problem? Maybe it is a bug, or i was doing > something wrong? > > I hope to hear from You soon! Thanks! > > Misha