Widget:ResultCounter

From Rinchen Terdzö
Revision as of 07:22, 5 April 2024 by Jeremi (talk | contribs) ((by SublimeText.Mediawiker))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<script>

var results = document.getElementsByClassName("result"); for (var i = 0; i < results.length; i++) { addCounter(results.item(i),i) }

function addCounter(element,index) { let counterDiv = element.querySelectorAll(":scope > div#resultIndex"); counterDiv.innerHTML = index; }

</script>