I am attempting to store an array in the HTML data tag. For example:
Try adding [ and ] to beginning and end (this makes it valid JSON). After doing so, you can use JSON.parse() to convert it to a native JavaScript object.
[
]
JSON.parse()