08.js

来自「进行ajax开发sdsd s d sd s」· JavaScript 代码 · 共 14 行

JS
14
字号
// Reverse the order of the children of Node nfunction reverse(n) {     // Create an empty DocumentFragment as a temporary container    var f = document.createDocumentFragment();     // Now loop backward through the children, moving each one to the fragment.    // The last child of n becomes the first child of f, and vice-versa.    // Note that appending a child to f automatically removes it from n.    while(n.lastChild) f.appendChild(n.lastChild);     // Finally, move the children of f all at once back to n, all at once.    n.appendChild(f);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?