I want the output in the middle without changing the pattern.
<script>
function start(){
let string = "";
for (let j = 0; j<= 5; j++) {
for (let i = 0; i < j; i++){
string += " *";
}
string += "<br>";
}
document.getElementById("result").innerHTML+=string;
}
window.onload = start;
</script>