I'm learning JavaScript at the moment , i was given a task to make a table with number of rows & columns given by the user.
I tried to do it using for loop but apparently I'm just making an infinite loop , I don't even know why it's infinite loop
function createTable(){
let table = document.getElementById("myTable")
let rows = window.prompt("Numbers of rows :")
let columns = window.prompt("Numbers of columns :")
for(let i = 1 ; i = parseInt(rows) ; i++){
let myrow = document.createElement("tr")
for(let ii = 1 ; ii = parseInt(columns) ; ii++){
let mycol = document.createElement("td")
mycol.textContent = "cell"
myrow.innerHTML = mycol
}
table.append(myrow)
}
}
<table id="myTable" border="1">
</table>
<form>
<input type="button" onclick="createTable()" value="Create the table">
</form>