I have this array structure :
var $obj = {
'sections1' : {
'row1' : {
'key1' : 'input1',
'key2' : 'inpu2'
},
'row2' : {
'key1' : 'input1',
'key2' : 'inpu2'
}
},
'sections2' : {
'row3' : {
'key1' : 'input1',
'key2' : 'inpu2'
},
'row4' : {
'key1' : 'input1',
'key2' : 'inpu2'
}
}
};
I want to fetch data from $obj->section2->row4->key2. How can I make it using jquery and javascript both.
UPDATE: I want it to print the value in a paragraph or div
<p id="array"></p>
$obj.section2.row4.key2just replace->with dots.