We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Load sort-array
a. From an ECMAScript Module
import sortArray from './node_modules/sort-array/dist/index.mjs'
b. The old-fashioned way (adds window.sortArray)
window.sortArray
<script nomodule src="./node_modules/sort-array/dist/index.js"></script>
Define this function
function sortElementChildren (el, sortOptions) { sortArray([...el.children], sortOptions).map(child => el.appendChild(child)) }
Sort a DOM elements children
sortElementChildren($('ul'), { by: 'textContent', order: 'desc' })