From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript concat() Method


String Object Reference JavaScript String Object

Definition and Usage

The concat() method is used to join two or more strings.

Syntax

stringObject.concat(stringX,stringX,...,stringX)

Parameter Description
stringX Required. One or more string objects to be joined


Example

Example

Join two strings:

<script type="text/javascript">

var str1="Hello ";
var str2="world!";
document.write(str1.concat(str2));

</script>

The output of the code above will be:

Hello world!

Try it yourself »


String Object Reference JavaScript String Object

From http://www.w3schools.com (Copyright Refsnes Data)