Search code examples
jquerytooltiptipsy

jquery combining <a> links id's


This is my current code in order for each of my

 $('#fbNameS1').tipsy({fade: true});
 $('#fbNameS2').tipsy({fade: true});
 ...
 $('#fbNameS207').tipsy({fade: true});
 $('#fbNameS208').tipsy({fade: true});

Now i've seen some jQuery code where they combined DIV ID's together. Before i go and do that to all 209 tipsy's i would like a comfirmation that this would work for the tipsy tooltips?

 $('#fbNameS1','#fbNameS2',....,'#fbNameS207','#fbNameS208').tipsy({fade: true});

Solution

  • You can try this:

    $('div[id^=fbName]').tipsy({fade: true})