darren-w-
asked on
Find function skips duplicates
Hi,
I have a div like this:
and when I run this in firebug: $('#hintdata').find('div') .each(func tion(index ,element){
console.log($(element).tex t());
})
it does not return the div's with the same number.:
I would like to aggregate each div so that for example :
Darren
I have a div like this:
<div id="hintdata"><div class='10003137'>Key Skills Level 3</div><div class='10003162'>Key Skills Level 3</div><div class='10003198'>Key Skills Level 3</div><div class='10030463'>Hairdressing</div><div class='10030475'>Hairdressing</div><div class='10038310'>Key Skills Level 3</div><div class='10038358'>Key Skills Level 3</div><div class='10038395'>Key Skills Level 3</div><div class='10058722'>Food level 2</div><div class='10064588'>Additional Maths</div><div class='10064588'>Additional Maths test100510</div><div class='50018048'>Welsh bacc Level 3</div><div class='50018073'>Art and Design</div><div class='50018097'>Art and Design</div><div class='50018103'>Art and Design</div><div class='50020481'>Food level 2</div><div class='50036725'>Travel and Tourism Year 12</div><div class='50036725'>Travel and Tourism Year 13</div><div class='50042555'>History of Art</div><div class='50067540'>Food Level 1</div></div></div>
and when I run this in firebug: $('#hintdata').find('div')
console.log($(element).tex
})
it does not return the div's with the same number.:
[div.10003137, div.10003162, div.10003198, div.10030463, div.10030475, div.10038310, div.10038358, div.10038395, div.10058722, div.50018048, div.50018073, div.50018097, div.50018103, div.50020481, div.50042555, div.50067540]
I would like to aggregate each div so that for example :
<div class='10064588'>Additional Maths</div> <div class='10064588'>Additional Maths test100510</div>
is edited to:
[code]
<div class='10064588'>Additional Maths<br />Additional Maths test100510</div>
How would this be done?Darren
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're welcome! Thanks for the points!
ASKER