Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>Challenge activity 2.5</title>
- </head>
- <body>
- <script>
- var my_string= prompt("Enter the phrase here");
- var spaceCount = my_string.split (" ").length-1;
- document.write("There are " + spaceCount);
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment