I am encountering an issue where my result is not printing line by line, instead everything shows up on a single line. How can I resolve this problem? Here is the code snippet I have tried:
<script>
function know(){
var num = Number(document.getElementById('number').value);
var range = Number(document.getElementById('range').value);
var output = "";
var final = [];
for(i = 1; i <= range; i++)
{
output = i * num;
final.push(output)
final = final.replace(",", "<br/>")
}
document.getElementById('result').innerHTML = final;
}
</script>