Getting objects referred to by other objects
I have a puzzle I am unable to crack.
I am using a custom HTML attribute with the value being the ID of another tag on the page.
I would like to get a JQuery set of all of the tags referred to that way by any tags on the page.
For example, lets say I have:
- <h1 id="bob">some header</h1>
- <p id="larry">some text</p>
- <p myAttr="bob">...</p>
- <p myAttr="larry">...</p>
- <input type="Submit" myAttr="bob" />
I want to get a query containing all tags with an id equal to the value of any other tag's myAttr, without duplicates.
Any ideas?
Jacob