2021-02-25 html 操作DOM相关的知识

2021-02-25  本文已影响0人  rub1cky

1. previousSibling

2. appendChild

3. attributes

<button id="myBtn" onclick="myFunction()">试一下</button>
截屏2021-02-25 下午9.24.28.png

4.className

5.cloneNode

6.className

var p1=document.getElementById("p1");
var p2=document.getElementById("p2");
p1.compareDocumentPosition(p2);

7. contentEditable

8.dir

9. firstChild

10. getAttribute

11. getAttributeNode

document.getElementsByTagName("a")[0].getAttributeNode("target");

12. getElementsByTagName

13. hasAttribute/hasAttributes

14. hasChildNodes

15. insertBefore

document.getElementById("myList").insertBefore(newItem,existingItem);

16. isEqualNode

17. isSameNode

18. lastChild

19. nextSibling

20. nodeName

21. normalize

22. parentNode

23. removeAttribute

24. removeChild

25. replaceChild

25. textContent

document.getElementsByTagName("BUTTON")[0].textContent;
上一篇下一篇

猜你喜欢

热点阅读