avi
avi

Reputation: 195

converting a normal string into a json array by including square brackets and double qoutes

I've a string: var textData = $('#textare').val();

where textData content is --> changed by arunesh,changed by avi

I want to convert it like --> ["changed by arunesh","changed by avi"], like a json array.

Upvotes: 1

Views: 114

Answers (1)

CY_
CY_

Reputation: 7618

// it will make it an array.
var arr = $('#textare').val().split(',');

Upvotes: 2

Related Questions