Bearbeiten Sie den Code:
Siehe Ergebnis »
Versuch es selber - ©
w3ii.com
<
!DOCTYPE
html
>
<
html
>
<
body
>
<
p
>
The concat() method joins two or more strings:
<
/p
>
<
p
id
="demo"
>
<
/p
>
<
script
>
var
text1 =
"Hello"
;
var
text2 =
"World!"
;
document.getElementById(
"demo"
).innerHTML = text1.concat(
" "
,text2);
<
/script
>
<
/body
>
<
/html
>
<!DOCTYPE html> <html> <body> <p>The concat() method joins two or more strings:</p> <p id="demo"></p> <script> var text1 = "Hello"; var text2 = "World!"; document.getElementById("demo").innerHTML = text1.concat(" ",text2); </script> </body> </html>