记录:split string

<button onclick="myFunction()">Try it</button> click button call myFunction

function myFunction() {
    var str = "How are you doing today?";
    var res = str.split(" ");
    document.getElementById("demo").innerHTML = res;
}

split string to arrary and put the result to id element

var res = str.split(“”); H,o,w, ,a,r,e, ,y,o,u, ,d,o,i,n,g, ,t,o,d,a,y,? var res = str.split(“ “); How,are,you,doing,today? var res = str.split(); How are you doing today? var res = str.split(“o”); H,w are y,u d,ing t,day?