let a = '{"userId": 1, "id": 1, "title": "delectus aut autem", "completed": false}'; let b = JSON.parse(a); document.getElementById("divid").innerHTML = b.title; // Using fetch fetch ('https://jsonplaceholder.typicode.com/todos/1') .then(res => res.json()) .then(json => document.getElementById("divid").innerHTML = json.title);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter