Well, what's the rest of your code? The snippet you've provided is fine, so there must be an issue with another code.
On Sep 22, 6:59 pm, switch13 <[EMAIL PROTECTED]> wrote: > Can anyone tell my why this might not work in a separate .js file but > it does work from the firebug debugger? > > On Sep 19, 5:45 pm, switch13 <[EMAIL PROTECTED]> wrote: > > > FF2 and I also tried IE6. The class is not getting added. That error > > is appearing in FireBug. Funny thing is, when I test it in the script > > window under the watch tab in firebug it works fine. > > > On Sep 19, 5:35 pm, "Aaron Heimlich" <[EMAIL PROTECTED]> wrote: > > > > Works fine for me (Firefox 3 on Mac OS X). What browser gave you that > > > error? > > > > On Fri, Sep 19, 2008 at 4:13 PM, switch13 <[EMAIL PROTECTED]> wrote: > > > > > I can't see why this wouldn't > > > > work: > > > > $('h1:contains("test")').parents('body').addClass("test_class"); > > > > -- > > > Aaron Heimlich > > > Web Developer > > > [EMAIL PROTECTED]