Javascript examples for String:split
Omit the separator parameter:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {/*w ww .j av a2 s . co m*/ var str = "The following code shows how to ?"; var res = str.split(); document.getElementById("demo").innerHTML = res; } </script> </body> </html>