微件:Extract collapsed navbox list

草awa留言 | 贡献2024年4月17日 (三) 22:54的版本 (Created page with "<script> const elements = document.getElementsByClassName('collapsed-navbox-list-base'); const lists = document.getElementsByClassName('collapsed-navbox-list'); const extracters = document.getElementsByClassName('collapsed-navbox-list-extracter'); if (elements.length !== 0) { for (let i = 0; i < elements.length; i++) { const element = elements[i]; if (element.style.display == 'hidden' || element.style.display == 'none' ) { const list = lists[i]...")
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

<script> const elements = document.getElementsByClassName('collapsed-navbox-list-base'); const lists = document.getElementsByClassName('collapsed-navbox-list'); const extracters = document.getElementsByClassName('collapsed-navbox-list-extracter');

if (elements.length !== 0) { for (let i = 0; i < elements.length; i++) { const element = elements[i];

       if (element.style.display == 'hidden' || element.style.display == 'none' ) {
           const list = lists[i];
           const cloned = list.cloneNode(true);
           const extracter = extracters[i];
           extracter.appendChild(cloned);
           element.remove();
       }
   }

} </script>