Question: Consider that i have the following html

```
<input type="text" id="other_floor_plans" name="other_floor_plans[]" value="["Pool","Office","Sprinkler","Boiler"]">

```

To fetch the values i use

```
a = $('#other_floor_plans').val()

```

It returns the following 

```
"["Pool","Office","Sprinkler","Boiler"]"

```

If i use a[0], it returns "[" as output. I need to get "Pool" as the first value. 

How to accomplish this?

Answer: 
Your value is a type of `string` which has a correct `JSON` syntax. Just parse with `JSON.parse` into the array and use your syntax.

```js
const value = '["Pool","Office","Sprinkler","Boiler"]';
const array = JSON.parse(value);

console.log(array[0]);
```
I think you need to change little bit of your code specially in markup.

changed your input markup into this `<input type="text" id="other_floor_plans" name="other_floor_plans[]" value='["Pool","Office","Sprinkler","Boiler"]'>`

then get value by jQuery

```
var a = $('#other_floor_plans').val(),
a = JSON.parse(a);
console.log(a[0]);

```

you need to use JSON.parse because you get json formate value and need to be parsed.

for my recommendation you just comma separate value like

```
<input type="text" id="other_floor_plans" name="other_floor_plans[]" value="Pool, Office, Sprinkler, Boiler">

```

then get first value by jQuery

```
var a = $('#other_floor_plans').val().split(",");
console.log(a[0]);

```

This one is much more readable and easy I guess.