152
edições
REMOVA OS ANÚNCIOS!
Apoiando através de https://apoia.se/arddhu a partir do tier de Apoiador, você pode navegar na wiki sem anúncios e ainda colabora com o projeto!
Sem resumo de edição |
Sem resumo de edição |
||
Linha 19: | Linha 19: | ||
/* Get the two elements you want to compare, | /* Get the two elements you want to compare, | ||
one from current row and one from the next: */ | one from current row and one from the next: */ | ||
x = rows[i]. | x = rows[i].querySelector("span.mw-headline"); | ||
y = rows[i + 1]. | y = rows[i + 1].querySelector("span.mw-headline"); | ||
// check if the two rows should switch place: | // check if the two rows should switch place: | ||
if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase() ) { | if (x.innerHTML.toLowerCase() > y.innerHTML.toLowerCase() ) { | ||
console.log(x.innerHTML); | |||
// if so, mark as a switch and break the loop: | // if so, mark as a switch and break the loop: | ||
shouldSwitch = true; | shouldSwitch = true; |