Why does the fun parameter transfer in innerHTML not work?

        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?

May.04,2021

'< li onclick= "selectcity ('+ pcities.id +', " '+ pcities.name +' ");" > '


 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>';
        }

'selectcity (' +'\ "'+ pcities [I] .id +'\",\ "+'+)

Menu