js字符串连接

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

</head>
<body>
字符串连接<br>
<p id="demo"></p>
<script>
var text1 = "Hello";
var text2 = "World!";
var text3 = text1.concat(" ",text2);
document.getElementById("demo").innerHTML = text3;
</script>

</body>
</html>

 

 学习网址:https://www.w3school.com.cn/js/js_string_methods.asp

posted @ 2019-11-20 18:11  田智凯  阅读(875)  评论(0编辑  收藏  举报