Currently, I am attempting to populate location data for Google Maps initialization. I have tried assigning an HTML input field with a JavaScript array format in order to use it for Google Maps, but unfortunately, my attempts have been unsuccessful. Here is the code snippet:
<input id="a" name="a" value='["WAPDA Town, Lahore, Pakistan","31.4311985","74.26435820000006","1"],["Johar Town, Lahore, Pakistan","31.469693","74.27284610000004","2"],'>
Afterwards, I call it within my script to initialize it for locations.
var location = '[' + document.getElementById('a').value + ']';
However, I am not getting the desired result and realize that I am doing something wrong. Can anyone suggest the proper way to initialize it?