[jQuery] Re: Wildcard selector AND pass the selector to a sub-function?

2008-12-13 Thread Daniel L
gt; $("div[id^=mydiv]").change(); > > This would find all divs with an ID that starts "mydiv". The > performance on the class method may be more efficient though. > > -Dan > > On Sat, Dec 13, 2008 at 8:30 PM, Daniel L wrote: > > > Hi, I have

[jQuery] Wildcard selector AND pass the selector to a sub-function?

2008-12-13 Thread Daniel L
Hi, I have a situation where the same javascript is repeated about 50 times - just with a differnt ID. Example: $('#mydiv1').change(function() { doStuff('#mydiv1'); }); $('#mydiv2').change(function() { doStuff('#mydiv2'); }); ... $('#mydiv50').change(function() { doStuff('#mydiv50'); });