0
'Cause when I put document.write
within the for
The list of innerHTML
he only sends the last position in the div
? I was wondering how do I do for the for
print within the div
from the beginning to the end of the list, but I’m not getting.
<head>
<meta charset=UTF-8/>
<link rel="stylesheet" type="text/css" href="main.css">
<script type="text/javascript" src="main.js"></script>
</head>
<body>
<input type="text" id="text">
<input type="button" id="click" value="click">
<input type="button" id="mos" value="mostrar">
<div id="div"></div>
</body>
<script>
var lista = [];
window.onload = function() {
var text = document.getElementById("text");
var click = document.getElementById("click");
var mos = document.getElementById("mos");
var div = document.getElementById("div");
click.onclick = function() {
lista.push(text.value + " <
br / > "); } mos.onclick=function(){ for (var i = 0; i <
lista.length; i++) {
div.innerHTML = lista[i];
}
}
}
</script>
Thank you very much helped me a lot
– user95454