排序元素:
w3.sortHTML(selector)
排序列表
實(shí)例
<button onclick="w3.sortHTML('#id01', 'li')">Sort</button>
嘗試一下 ? 添加上CSS ?
排序表格
實(shí)例
<th onclick="w3.sortHTML('#myTable','.item', 'td:nth-child(1)')">Name</th>
<th onclick="w3.sortHTML('#myTable','.item', 'td:nth-child(2)')">Country</th>
嘗試一下 ? 添加上CSS ?
更多建議: