hello im trying to parse an api
</div>
<div id=test>
</div>
</body>
<script type="text/javascript" src="js/jest1.js"></script>
<script>
var xhr = new XMLHttpRequest();
xhr.open("GET", "apikey", false);
xhr.send();
console.log(xhr.status);
console.log(xhr.response);
var parsed = JSON.parse(xhr);
document.getElementById('test').innerHTML = myObject.description;
</script>
when i do this without the parsing i see all the information in the console im trying to get the information out of the console and assign it to objects. in this case it's cnn news articles. This would be the api's outputs
"status": "ok", "source": "cnn", "sortBy": "top", "articles": [{
"author": "Clarissa Ward, Waffa Munayyer, Salma Abdelaziz, and Fiona Sibbett, CNN",
"title": "Gasping for life: Syria's war on children",
"description": "Harrowing new footage of the chemical attack on the town of Khan Sheikhoun reveals the depravity of the Syrian regime, reports CNN's Clarissa Ward.",
"url": "http://www.cnn.com/2017/05/09/middleeast/syria-chemical-attack-ward/index.html",
"urlToImage": "http://i2.cdn.cnn.com/cnnnext/dam/assets/170509143050-syria-clarissa-ward-video-hp-tease-super-tease.jpg",
"publishedAt": "2017-05-09T20:01:16Z"
}]
i dont believe i ever called getjson() i never really used it and am calling the parse without declaring im getting json what im trying to do is output the description from the api and right now it's displaying at undefined in the element