Perfect...

Thanks for your help.

Greatly appreciated.

Dave

-----Original Message-----
From: James [mailto:james.gp....@gmail.com] 
Sent: June-03-09 3:55 PM
To: jQuery (English)
Subject: [jQuery] Re: Newbie question on selectors


$("a[class^=edit_]").click(...);

This is saying: all <a> with class that begins with 'edit_'.

http://docs.jquery.com/Selectors

On Jun 3, 8:20 am, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> I have a page with 6 links that each have a unique class ; 
> edit_profile edit_preferences edit_journal edit_entry.... and so on
>
> now I built 1 function based off edit_profile 
> $("a.edit_profile").click(function(){
> var url_id = $(this).attr('href');
> do stuff......
>
> });
>
> but rather than writing the same function and changing the selector 
> everytime how can i get this all into 1 function?
>
> Thanks,
>
> Dave

Reply via email to