Advertisement
Meruem

s.split()

May 2nd, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4.  
  5. <p>Click the button to display the array values after the split.</p>
  6.  
  7. <button onclick="myFunction()">Try it</button>
  8.  
  9. <p id="demo"></p>
  10.  
  11. <script>
  12. function myFunction() {
  13.     var str = "How are you doing today?";
  14.     var res = str.split(" ");
  15.     document.getElementById("demo").innerHTML = res;
  16. }
  17. </script>
  18.  
  19. </body>
  20. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement