That snippet of Javascript is fine. I just tested it.

If it still isn't working, I'd wager there's some invalid syntax elsewhere that's causing it all to break. Might be easier if you pasted/PMed me the entire page's source code.

And yes, jQuery is great