Klaus Hartl schrieb:
> Kurt Mackey schrieb:
>
>> Is there a “jQuery” way of getting an event’s click target? I tend to
>> use those elements quite a bit, but getting them is a pain. J
>>
>
> Hi Kurt,
>
> jQuery provides no functionality to retrieve the target. Here's my way
> to do that:
>
>
> $( ... ).click(function(e) {
> var ev = e || event;
> var target = ev.target || ev.srcElement;
> $(target).css('border', '1px solid red');
> });
>
> Maybe that should be abstracted by jQuery...
>
The first line is not necessary, afaik that is already normalized by
jQuery. I'm not sure about the second one...
-- Jörn
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/