Hello, I am making a simple page, it is just 2 text boxes, 1 text box that you will type a word, the second text box for how many times you want that word repeated in the output. I got it to repeat the word as many times as i typed in, but the first line of output says undefined. Help Please!! my code is:
function repeatWord() {
var word = document.getElementById("word").value;
var repeatnum = parseInt( document.getElementById("repeatnum").value);
for( var count = 1; count <= repeatnum; count++ ) {
var msg = msg + "<div>" + word + "</div>";
console.log;
}
document.getElementById("results").innerHTML = msg;
}