Answers for "sort divs alphabetically jquery"

1

sort divs alphabetically jquery

$('.sortme').sort(function(a, b) {
  if (a.textContent < b.textContent) {
    return -1;
  } else {
    return 1;
  }
}).appendTo('body');
Posted by: Guest on August-30-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language