Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var table = document.getElementById("the-table-body")
- var sort1 = document.getElementById("sort-button-1")
- var sort2 = document.getElementById("sort-button-2")
- var sort3 = document.getElementById("sort-button-3")
- var l1 = []
- window.addEventListener("load", function(){
- sort1.addEventListener('click', sorting);
- sort2.addEventListener("click", sorting);
- sort3.addEventListener("click", sorting);
- });
- function sorting(){
- for (var i = 0; i < table.rows.length; i++) {
- l1.push(table.rows[i]);
- console.log(table.rows[0].cells[0].innerText);
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement