What about

$("#firstEl").click(function(){
  alert($(this).attr("class"));
});

Glen

On 10/31/07, Wizzud <[EMAIL PROTECTED]> wrote:
>
>
> $(selector).click(function(){
>   var equiv = $('#' + this.className);
>   if(equiv.length){
>     // found element with relevant id, so now do something...
>     ;
>   }
> });
>
> This is simplified, assuming that you don't have multiple classes on
> anything that 'selector' assigns the click function to.
>
> On Oct 31, 6:19 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > Hello,
> > Here's what I'm trying to do:
> > When someone clicks on an element: jQuery will ask that element what
> > it's class name is.
> > Then jQuery will select another element whose ID is equivalent to the
> > first element's class name.
> >
> > I don't know how to get jQuery to ask the first element what its class
> > is?
>
>

Reply via email to