I have the following code which is generated in PHP:
<div id='container1' data-history="[["test", "test title", "", []]]">
I wish to have this accessible in javascript but when I use console.log(history[0]) it outputs '[' so its treating the array as a string.
Is there a way to have it so that javascript can read it as an array?
My PHP code is as follows (i removed the slashes and '' around the array)
echo '<div id="container1" data-history=[[0]["test", "test title", "", []]] data-current-url="'.$url.'">';