You don't actually need the * at the start of the selector, it's
implicitly there.

In the click function, to work out what has been clicked, you can do:

    var tag = this.nodeName.toLowerCase();

Tag should be the tag name.

Karl Rudd

On 3/13/07, John Cotton <[EMAIL PROTECTED]> wrote:
>
>
> Sorry if this is a really thick question, but I've hunted for over an hour
> on the website/Google/anywhere to find this and am getting nowhere.....
>
> I have the following code:
>
>   $("*.selectable").click( function(e) {
>    $(this).toggleClass("selected");
>
>    saveCookie($(this).attr("id"),
> $(this).attr("class").indexOf("selected"));
>   });
>
> which works fine.
>
> But I want to know which element within *.selectable was actually clicked
> (eg an anchor, an image etc).....
>
> How do I do that?
>
> Thanks in advance
>
> John
>
>
> --
>  No virus found in this outgoing message.
>  Checked by AVG Free Edition.
>  Version: 7.5.446 / Virus Database: 268.18.9/719 - Release Date: 12/03/2007
> 08:41
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>

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

Reply via email to