troubleshooting Question

jQuery grouping of dynamically generated horribleness

Avatar of GreatGerm
GreatGermFlag for United States of America asked on
JavaScriptjQuery
6 Comments1 Solution306 ViewsLast Modified:
I'm sure I'm just being dumb here, but I need some help with how to approach this with jQuery.

Let's use this example data set:

<a rel="group1" href="./example/7_b.jpg" title="Lorem ipsum dolor sit amet"><img alt="" src="./example/7_s.jpg" /></a>
<a rel="group1" href="./example/8_b.jpg" title=""><img alt="" src="./example/8_s.jpg" /></a>
<a rel="group1" href="./example/9_b.jpg" title=""><img alt="" src="./example/9_s.jpg" /></a>
<a rel="another_group" href="./example/7_b.jpg" title="Lorem ipsum dolor sit amet"><img alt="" src="./example/7_s.jpg" /></a>
<a rel="another_group" href="./example/8_b.jpg" title=""><img alt="" src="./example/8_s.jpg" /></a>
<a rel="another_group" href="./example/9_b.jpg" title=""><img alt="" src="./example/9_s.jpg" /></a>
<a rel="another_group_too" href="./example/7_b.jpg" title="Lorem ipsum dolor sit amet"><img alt="" src="./example/7_s.jpg" /></a>
<a rel="another_group_too" href="./example/8_b.jpg" title=""><img alt="" src="./example/8_s.jpg" /></a>
<a rel="another_group_too" href="./example/9_b.jpg" title=""><img alt="" src="./example/9_s.jpg" /></a>

What I'd like to do is have a jQuery function applied to each group that is designated by the rel attribute.  Seems pretty simple so far I know, but the problem is that the code is dynamically generated based on user input and what's in the rel tag can be pretty much anything and the groups may have any number of items.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros