Could you give us a little more context about what this code is running in? I could be totally off here, but it looks more like JavaScript than
Java to me. Perhaps if you compile and get errors, or run and get errors or exceptions, you could post those too.
Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4 all those years ago...)