I am trying to get a user input to display the amount of rows they would like of "+++". I have tried a lot of things and nothing is working!!! I am currently using document.getElementById('square').innerHTML = text; , as my code to display it but nothing is happening, I am also not getting any error messages in my console. Please help!!!
function loop4(){
var rows = +prompt ('Please enter the ammount of rows you would like')
var num = 0
var text = ''
while (num !==rows){
text+= '+++ \n';
num +=1;
}
document.getElementById('square').innerHTML = text;
<input class='button' id='square' type='button' onclick="loop4()" value='Draw Square' /> <br>