I'm working on project which don't use jQuery but only JavaScript and we have a need to sort alphabetically ascending a table values (without any external library).
The objective is to sort rows elements each time a column (th element) is clicked.
Example
If I have this table
When I click on "Names", the table should be refreshed like that:
When I click on "Tel", the table should be refreshed like that:
I'm sharing my own solution here. If you have any remark or suggestions, please share.
I'm updating my solution by adding an inverse order feature: