Prev Demo
JavaScript
>
Concat() Method
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>concat() method</h1> <p>Click on the "Button" to join the three strings.</p> <input type="button" value="Click to Join" onclick="Function()" /> <p id="myId"></p> <script> function Function() { //This is a String// var a = "Tech"; //This is a String// var b = "Funda"; //This is a String// var c = ".com"; var res = a.concat(b).concat(c); document.getElementById("myId").innerHTML = res; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output