Add js for sorting elements