Hopefully I explain this correctly.
So what I have is a data-attribute which contains a lot of data, in this instance I want to find each individual basket product ID and spit them out as separate strings.
The main thing I am struggling with is how to actually find this amongst the other data that is present
Here is the markup I am working with:
<div class="hidden js-page-context" data-page-context="{
"basketProductIds": "FZZ83047-157-16,FZZ84695-173-20",
"basketLastModified": "Mon Aug 12 12:06:43 GMT 2019",
"redirectUrl": "https://www.test.com"
}"></div>
var test = $('.hidden').attr("data-page-context");
console.log(test);
CodePen: https://codepen.io/nickelse/pen/JgxmBb
Any help would be awesome :D