I want to use the .each and .attr function to get div ids. I know how to do that, but what I want to do is grab each div ID from the DOM with a certain class (let’s say “edit” class) and .append some data into that div.
Here’s what I am having trouble with: I want to put the ID of that particular DIV in the .each loop inside the .append. For example: if I wanted to put a link inside the .append, I would want the link to be http://www.website.com/index.php?id=1&div=DIV-ID
Any ideas, and I’m sorta a novice, so can you provide code example. I understand attr and .each though to an extent.
http://jsfiddle.net/WrGLC/1/
For the sake of keeping it on this page:
HTML:
JS: