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
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');
});
2 matches
Mail list logo