var jsn = JSON.stringify($.map($('div.google-map-marks div'), function(e, i) { e = e.childNodes; return {id: ++i, latitude: e[0].textContent, longitude: e[1].textContent} })) console.log(jsn )