Have you tried this :

$('#list_element > ul > li').click(function() {
  $(this).addClass('some_class');
});

it's a shortcut for the bind method. Other events are supported also.

Balkanski schreef:
> Hi, the following problem occurred to me under IE. Firefox is dealing OK with
> the code.
>
> For example :
>
> $('#list_element > ul > li').bind('click', function() {
>   $(this).addClass('some_class');
> });
>
> IE throws a JS error
>
> I think that under IE 'this' is not recognized as the object just being
> clicked.
> If we have in the body of the function - alert(this.tagName) - 
> FF - alerts 'LI'
> IE - alerts 'undefined'
>
> I'll be very grateful for any sugestions and solutions, thanks in advance.
>   


-- 
David Duymelinck
________________
[EMAIL PROTECTED]


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to