Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Split a String from Space</title> </head> <body> <script> var myStr = "The quick brown fox jumps over the lazy dog."; var strArray = myStr.split(" "); // Display array values on page for(var i = 0; i < strArray.length; i++){ document.write("<p>" + strArray[i] + "</p>"); } </script> </body> </html>