How to read textarea with certain condition
- by user281180
I have a textarea in which the user enters the following data:
Paul:Nine, Rome
Jenny:Five, India
Bob
I want to read the data and store the values before the colon in an array and the values after the colon in another array. Please note that the user may not enter values after the colon like in case 3 above. In such case, the value must be stored in the first array as if it is before the colon.
How can I do that using jquery?