I have this really big text where I want to add line breaks in order to look better on my application. I have tried using
"<br>", "\n"
to cut the text in pieces. I have ven tried to change the width of the span but nothing seems to be working. What am I doing wrong? Any help appreciated.
<span id="instr" style="color: white; font-size: 15pt;"></span>
<script type="text/javascript">
function instructions(){
....
document.getElementById("instr").textContent = "Really biiiiiiiiiiiiiiiiiiiiiiiiig text here";
}
</script>
To set <br /> line breaks you need to use innerHTML property:
document.getElementById("instr").innerHTML = "Really<br />biiiiiiiiiiiiiiiiiiiiiiiiig<br/ >text here";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With