I can not go through the for. since the variables that store the document elements are not concatenated. What I'm looking for is to make a counter of the ones that are inside the id menu and its li.
addEventListener('click',eventoE,false);
function eventoE(e) {
// e.preventDefault();
var div = document.getElementById('menu');
var ve = div.getElementsByTagName('li');
var a = ve.getElementsByTagName('a');
for (var i = 0; i < a.length; i++) {
console.log(ve);
document.write(ve);
}
}
<!DOCTYPE html>
<html>
<head>
<title>Comentarios</title>
<script src="ajax.js"></script>
</head>
<body>
<div id="menu">
<li><a href="#">Enlaces creados 1</a></li>
<li><a href="pagina1.php?fecha=12-10-2018">Enlaces creados 2</a></li>
<li><a href="pagina1.php?fecha=13-10-2018">Enlaces creados 3</a></li>
</div>
<div id="container" style="border : 1px solid red;padding: 60px;width: 300px; margin: 20px;"></div>
</body>
</html>