I'm sending variables to a text box as a concatenated string so I can include multiple variables in on getElementById call.
I need to specify a line break so the address is formatted properly.
document.getElementById("address_box").value =
(title + address + address2 + address3 + address4);
I've already tried
after the line break and after the variable. and tried changing the concatenation operator to +=.
Fixed: This problem was resolved using;
document.getElementById("address_box").value =
(title + "
" + address + "
" + address2 + "
" + address3 + "
" + address4);
and changing the textbox from 'input type' to 'textarea'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…