Widget:ResultCounter: Difference between revisions

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


var results = document.getElementsByClassName("result");
var results = document.getElementsByClassName("result");
 
for (var i = 0; i < results.length; i++) {
results.forEach(addCounter)
function addCounter(results.item(i)) {
 
let index = element.indexOf();
function addCounter(element) {
let counterDiv = element.querySelectorAll(":scope > div#resultIndex");
let index = element.indexOf();
counterDiv.innerHTML = index;
let counterDiv = element.querySelectorAll(":scope > div#resultIndex");
}
counterDiv.innerHTML = index;
}
}


</script>
</script>

Revision as of 07:19, 5 April 2024

<script>

var results = document.getElementsByClassName("result"); for (var i = 0; i < results.length; i++) { function addCounter(results.item(i)) { let index = element.indexOf(); let counterDiv = element.querySelectorAll(":scope > div#resultIndex"); counterDiv.innerHTML = index; } }

</script>