Omit the separator parameter: - Javascript String

Javascript examples for String:split

Description

Omit the separator parameter:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials