Edit3: To hide your div not created from your loop simply wrap your div with another wrapper (that has display: none;) like so:
<div style="display: none">
<div id="wrapper">
<input name="num" type="button" class="btn1" id="num" value="1" />
<div id="from">From:</div>
<div id="startcity"></div>
<div id="to">To:</div>
<div id="finalcity"></div>
</div>
</div>
Notice that if you add "display: none" to your actual wrapper then the divs created with your loop won't be displayed. This is because .cloneNode also clones the style.
Edit2:
You are using position: absolute; and setting the position of each of these elements on top of one another. This also shows that you are using the same id multiple times... which you should avoid. id's should be unique.
#apo {
position: absolute;
width: 39px;
height: 23px;
z-index: 1;
left: 126px;
top: 34px;
}
#startpoli {
position: absolute;
width: 200px;
height: 37px;
z-index: 2;
left: 213px;
top: 19px;
background-color: #98d0d2;
}
#pros {
position: absolute;
width: 48px;
height: 25px;
z-index: 3;
left: 122px;
top: 74px;
}
#finalpoli {
position: absolute;
width: 200px;
height: 37px;
z-index: 4;
left: 213px;
top: 69px;
background-color: #c6d298;
}
This is the result when I remove some of your css causing the problems:

Here is the modified css for the image on top:
#wrapper {
background-color: #e5e4e2;
height: 200px;
width: 600px;
padding: 5px;
font-family: Georgia, "Times New Roman", Times, serif;
}
.btn1{
background-color: #CAC9DB;
width: 40px;
height: 40px;
font-size: 24px;
font-weight: bold;
padding: 5px;
display: inline-block;
}
#apo {
text-align: justify;
vertical-align: top;
display: inline;
margin-top: -10px;
}
#startpoli {
}
#apo {
width: 39px;
height: 23px;
}
#startpoli {
width: 200px;
height: 37px;
background-color: #98d0d2;
}
#pros {
width: 48px;
height: 25px;
}
#finalpoli {
width: 200px;
height: 37px;
background-color: #c6d298;
}
Edit: It seems that the wrapper doesn't allow itself to be added to multiple elements at the same time. So just clone ( with .cloneNode(true) ) the original er
li.appendChild(er) doesn't return an element last I checked. Just append li to your list instead of qw
var er = document.getElementById('wrapper');
for(var n=0;n<3;n++){
var li = document.createElement("li");
li.appendChild(er.cloneNode(true)); //clone original wrapper and add it to your li
document.getElementById('list').appendChild(li); //add li to your list
}
Demo
From : To:but anythin else because I don't see where you add your information in these tags. A working example would be very useful.