1
<p id="demo">单击按钮显示分割后的数组</p>
2
<button onclick="myFunction()">点我</button>
3
<script>
4
function myFunction() {
5
var str = "How are you doing today?";
6
var n = str.split("o");
7
document.getElementById("demo").innerHTML = n;
8
}
9
</script>