Question: / / Fetch current headlines from the web server fetch ( headlines . xml ) . then ( response = > response.text (
Fetch current headlines from the web server
fetch headlinesxml
then response response.text
then str new DOMParserparseFromStringstr "textxml
Write the XML content to HTML
then dom
let items dom.querySelectorAllitem;
Loop through each story item
for let story of items
Write the story content and append it to the page
let headline story childrentextContent;
let link story childrentextContent;
let summary story.childrentextContent;
newS.insertAdjacentHTMLbeforeend htmlCode;
;
i does not prin the html code properly
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
