i have this function:
[CODE]function getT(e)
{
var totals=0
for(var k in e)
{
var count=e[k];
var p=document.createElement(“p”);
p.id=”tag_”+totals;
var dv=document.createElement(“div”)
dv.id=”iDs_”+totals;
var a=document.createElement(“a”);
a.className=”norm”;
a.href=”#”
a.onclick=function (){new GROUP(k,dv);return false;}
var placeName=document.createTextNode(k+”(“+count+”)”);
a.appendChild(placeName);
p.appendChild(a)
p.appendChild(dv)
resultTag.appendChild(p)
totals++;
}
}
it works fine, except one thing…in the new GROUP method, “k” always represents the last element in “e” and dv always represents the last dv created end of the loop. However, in the placeName var, it represents the unique elements in e, and all the dv tags are numeric/proper. For example, if e where [‘mom’,’dad’,’me’], placeName would be each name respectively…but in the new Group(k,dv) call, k is always “me” and dv is always 2….ideas?