var lis=document.querySelectorAll(".navCity li");
lis.forEach(function (ele,index) {
console.log(ele);
console.log(index);
});
$(".navCity li").each(function (index,ele) {
console.log(index);
console.log(ele);
});
var cars = ["BMW", "Volvo", "porsche", "Ford", "Fiat", "Audi"];
var text = "";
var i;
for (i = 0; i < cars.length; i++) {
text += cars[i] + "<br>";
}
document.getElementById("demo").innerHTML = text;