The answers given here (use is and addClass and removeClass for
element classes) are correct, but the more general problem is using
reserved words in objects. You can always quote them and they'll work:

{
class: 'foo',
for: 'foo',
function: 'foo'
}

all fail, but
{
'class': 'foo',
'for': 'foo',
'function': 'foo'
}

are fine

On Dec 1, 6:14 pm, Gordan <[EMAIL PROTECTED]> wrote:
> I'm loosing my mind over this :-(http://www.writesomething.net/users/("show 
> classical users list"
> link)
> I have a few lines of code which are extremly simple and work as
> expected in FF, but IE is refusing to cooperate :-(
> I tried literally everything but it just returns the "expected
> identifier, string or number" error.
> Please help, this has to be some simple bug that I'm overseeing :-
> ( thank you
> here's the complete code, and I use the latest 1.2.1 jQuery: (IE says
> that the error is on the 3rd line)
>
> function change_users_display() {
> if ($('#users').attr('class') == 'users_cloud') {
> $('#users').attr({class: ''});
> $('#change_users_display_classical').show();
> $('#change_users_display_cloud').hide();} else {
>
> $('#users').attr({class: 'users_cloud'});
> $('#change_users_display_classical').hide();
> $('#change_users_display_cloud').show(); }
> return true; }

Reply via email to