[jQuery] Re: Assigning variable on click

2009-04-15 Thread Josch
You initialize the variable within your function (var color). This means the variable works only within the function. You have to initialize it outside your function (Before $ (span.yellow).click()). Josch On 15 Apr., 15:26, Connor con...@letsbeglobal.com wrote: Hi, One other quick

[jQuery] Re: Assigning variable on click

2009-04-15 Thread Connor
Really? So then how would I assign the variable so it would work anywhere when a certain element is clicked? On Apr 15, 9:16 am, Josch jluelsd...@googlemail.com wrote: You initialize the variable within your function (var color). This means the variable works only within the function. You

[jQuery] Re: Assigning variable on click

2009-04-15 Thread Connor
Nevermind. I realized that I just needed to assign a global variable instead. ie taking out the var. On Apr 15, 10:25 am, Connor con...@letsbeglobal.com wrote: Really? So then how would I assign the variable so it would work anywhere when a certain element is clicked? On Apr 15, 9:16 am,