Javascript Login Value
4 answers
String concatenation:
document.getElementById('input2').value = "stuff" + document.getElementById('input1').value + "other stuff"; When working with numbers, you can start by concatenating with an empty string, so as not to add numbers together, and not to concatenate strings (due to the order in which the operator is evaluated):
document.getElementById('input2').value = "" + 1234 + 567 + document.getElementById('input1').value + 89; +1
user159088
source share