1
<p> + 号运算符用于连接字符串。</p>
2
<button onclick="myFunction()">点我</button>
3
<p id="demo"></p>
4
<script>
5
function myFunction() {
6
var text1 = "Good ";
7
var text2 = "Morning";
8
text1 += text2
9
document.getElementById("demo").innerHTML = text1;
10
}
11
</script>