I'm trying to capture a value from an object in a data attribute. The example below is a shortened version of the element I'm working with.
<div class="interest-select" data-ixp-input-state={
"instanceId":"iMABIId8pUGkQNMZ4izOLg",
"dataField":{\"id\":694,\"name\":\"ProductInterest\"}",
"validation":"valid",
"required":true,"value":"career",
"hasValue":true"}</div>
So far I've tried a few variations of the jQuery below, however this keeps returning undefined:
var stateObj= $(".interest-select").attr("data-ixp-input-state")
var value= stateObj[5]//this should be equal to "career"