[jQuery] Re: Passing a variable into the $('selector') function

2008-07-03 Thread Stompfrog
msg was actually myDiv and in the end i got it to work with.. $('#'+msg) Thanks very much for your helpful reply. Cheers On Jul 2, 11:16 pm, "Erik Beeson" <[EMAIL PROTECTED]> wrote: > If msg is '#myDiv' and you have element with id="myDiv", then $(msg) will > select it. > > If you think that's

[jQuery] Re: Passing a variable into the $('selector') function

2008-07-02 Thread Erik Beeson
If msg is '#myDiv' and you have element with id="myDiv", then $(msg) will select it. If you think that's what you're doing and it isn't working for you, either your id is wrong or msg doesn't hold what you think (maybe it has a trailing \n?). --Erik On 7/2/08, Stompfrog <[EMAIL PROTECTED]> wrot