Widget:ResultCounter: Difference between revisions

From Rinchen Terdzö
((by SublimeText.Mediawiker))
((by SublimeText.Mediawiker))
Line 6: Line 6:
}
}


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

Revision as of 07:21, 5 April 2024

<script>

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

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

</script>