dreamysky

方法:insertAdjacentHTML(postion,html);

   insertAdjacentTEXT(postion,text);

参数:

position 是相对于 element 元素的位置,并且只能是以下的字符串之一:

1. beforeBegin: 插入到标签开始前

2. afterBegin:插入到标签开始标记之后

3. beforeEnd:插入到标签结束标记前

4. afterEnd:插入到标签结束标记后

html 是 需要添加的标签节点

text 是文本

参考地址:https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-04-13
  • 2021-12-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2019-11-06
  • 2021-12-19
相关资源
相似解决方案