for (var i = 0; i < pcities.length; iPP) {
//pcities[i]//{name: "", id: 438}
str2 += "<li onclick="selectcity("+ pcities[i].id+","+pcities[i].name +");"><i class="datadd" ></i></li>";
}
cittty.innerHTML = str2;
for (var i = 0; i < pcities.length; iPP) {
oI[i].innerHTML = pcities[i].name;
oI[i].id = pcities[i].id;
}
I want to write a method for each li to selectcity, his id and name, but when I click on Xingan, I will report "Xingan is not defined" . If the parameter is directly written in pcities [I], it becomes "selectcity ([object Object]);" , what should I do with the passed parameters?