Monday, November 2, 2009

[jQuery] Issue when caching jquery objects

Hi,

I usually cache jquery objects in variables or a config object.

Lately I ran into a strange issue with that when trying to do this:

$myCachedSelector.attr('disabled', false);

The selected object simply remained to be disabled.

When I used the normal syntax $('#mySelector').attr('disabled',
false); it worked.

I'm not sure if it's a problem with my script of some kind of "bug"?

Any ideas?

Thanks!

No comments: