Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <body> <div>post title: <span id="spanId"></span></div> <script> async function fillTheTitle() { const post = await fetch("https://jsonplaceholder.typicode.com/posts/1").then((res) => res.json()); document.getElementById("spanId").innerText = post.title; } fillTheTitle(); </script> </body> </html>