<!DOCTYPE html>
<html>
<body>
<h1>JavaScript Function</h1>
<h2>The split() Method</h2>
<p>split() splits a string into an array of substrings, and returns the array:</p>
<p id="workingcode"></p>
<script>
var text = "How are you doing today?";
var getText = text.split(" ");
document.getElementById("workingcode").innerHTML = getText;
</script>
</body>
</html>
Output
JavaScript Function
The split() Method
split() splits a string into an array of substrings, and returns the array:
How,are,you,doing,today?
Split function JavaScript
admin Changed status to publish December 19, 2023
Sorry, you do not have permission to read comments.