How to make this format:
$('a[href*=wikipedia.org/][rel]').each(function()
But with a div instead of a href
$('#block_profile[rel]').each(function () {
Anyone can show how and clarify why? the problem is my custom 2nd line of code does an action on every block_profile there are 10 of them on a page, if I click the 10nd the action is executed 10 times, If I click the 8th block_profile than the action is triggered 8times, whats a solution to fix this? thx!
My HTML is like this:
<div rel="2" id="block_profile" class="block_profile">
...
</div>
First of all you have to use
classinstead ofid, becauseidshould be unique andclasscan be used for a group and to select alldivswithclass='block_profile'andrelyou can useDEMO. (See in the console)