Let's just say I have this function( function()
not shown):
document.getElementById("chatDisplay").value= document.getElementById("chatDisplay").value + userName + ":" + document.getElementById("textBox").value
what I want to do is between chatDisplay
(within) the .value=
and the userName
is too push that line of code down(similar to a <br>
).Is there anyway to get that done?
Use \\n
. It works exactly as <br>
but it is used for text. It means new line
...."chatDisplay").value + "\n" + userName....
Use
Line Feed and
Carriage Return instead of <br/>
:
<textarea cols='60' rows='8'>Hello. World How are you?</textarea>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.