I want to retrieve the data inside a JSON object, but when I tried to alert it, or log it, I got [Object Object] or undefined. Say I'm getting the json object in a div with id = "page". This's what I did:
console.log($("#page").val()); //gives undefined
console.log($("#page").toString()); // gives [Object Object]
I'm getting the JSON object inside a div I introduced
<div id="page"></div>
From here I was trying to get the JSON object.
So how do I get the data inside this object?
$("#page")[0]?$("#page")is jQuery object, sotoString()on it gives[Object object]JSON.stringify($("#page"))