Question: I constructed table row with custom data attributes, using php:

```
<tr id="92280001" style='font-weight:bold' data-seqSet={'set':'1',seq1:'foo',seq2:'bar'}>

```

in my script i need to get these values (set,seq1,seq2), when clicking on table row:

```
isSet=$(this).closest('tr').data('seqset').set;
console.log(isSet);

```

it gives me undefined. I need it equals 1. But when i use:

```
isSet=$(this).closest('tr').data('seqset');
console.log(isSet);

```

Then it prints whole JSON. What i missing?

Answer: 
As @dfsq pointed out to me jQuery .data() will parse the attribute as an object if a properly formatted JSON string is detected. So the solution is to correct your JSON formatting to wrap the key values in `"`

```
data-seqSet = {"set": "1", "seq1": "foo", "seq2": "bar"}

isSet = $(this).closest('tr').data('seqset').set;
alert(isSet);

```
in php echo must be:`echo "<tr id='92280001' style='font-weight:bold' data-seqSet='{\"set\":\"1\",\"seq1\":\"foo\",\"seq2\":\"bar\‌​"}'>";`