I have the following code
for (a in secciones){
ncompoa += "<h1>";
ncompoa += secciones[a];
ncompoa += "</h1>";
ncompoa += "<ol>";
for (li in producto) {
if (producto[li].grupo == secciones[a])
{
ncompoa += "<li>";
ncompoa += producto[li].n;
ncompoa += "</li>";
}
}
};
ncompoa += "</ol>";
document.getElementById('contenido').innerHTML = ncompoa;
What results in the following:
TITLE1
Content
TITLE2
Content
TITLE3
And the result I want is to be:
TITLE1
TITLE2
TITLE3
Can someone guide me what should I do or where should I place the
ncompoa += "<ol>";
so that this label is excluded from the first for ..?