📌  相关文章
📜  js 获取查询选择器 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:37.809000             🧑  作者: Mango

代码示例1
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);
  })