или так (
if (city[i] === "Город2") goroda.onclick=()=>location = 'http://google.com/';
) вот эту строку в твой код добавил
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<div id="list"></div>
<script>
var div = document.getElementById('list');
var city = ["Город1", "Город2", "Город3","Город4","Город5","Город6"];
for (var i = 0, ln = city.length; i < ln; i++) {
var goroda = document.createElement('li');
goroda.innerHTML = city[i];
if (city[i] === "Город2") goroda.onclick=()=>location = 'http://google.com/';
list.appendChild(goroda);
}
</script>
</body>
</html>