js 調用向html追加內容


方法:

insertAdjacenthtml(postion,html);
insertAdjacentTEXT(postion,text);

廣州vi設計公司 http://www.maiqicn.com 我的007辦公資源網 https://www.wode007.com

參數:

position 是相對於 element 元素的位置,並且只能是以下的字符串之一:

1. beforeBegin: 插入到標簽開始前

2. afterBegin:插入到標簽開始標記之后

3. beforeEnd:插入到標簽結束標記前

4. afterEnd:插入到標簽結束標記后

html 是 需要添加的標簽節點
text 是文本


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM