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]);
```
There you doing a wrong practice when you initialize value in input box you must contain a value in different quotation symbols.
there you take " for value assign and " also for array string, that truncate your string on the second " that's why this return only [ in your value.
**Try to use like this:**

> 
> HTML
> 
> 
> 

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

```

> 
> JQuery
> 
> 
> 

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

```