Skip to content
Advertisement

Read values from text field individually

I would like to read all values from a text field/text box individually and then write them to a table:

Example:

JavaScript

Output:

  1. This
  2. is
  3. an
  4. example
  5. of
  6. a
  7. text
  8. I
  9. want
  10. to
  11. read
  12. out

How can I use a loop to read the text field/textbox? That is, whenever a space comes the new subsequent value must be in a new line.

Advertisement

Answer

String:

JavaScript
JavaScript
JavaScript

Input:

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement