Answers for "js fetch queryselector"

0

js fetch queryselector

fetch("https://enable-cors.org/")
  .then(response => response.text())
  .then(text => {
    const parser = new DOMParser();
    const htmlDocument = parser.parseFromString(text, "text/html");
    const section = htmlDocument.documentElement.querySelector("section");
    document.querySelector("div").appendChild(section);
  })
Posted by: Guest on August-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language