Widget:ResultCounter: Difference between revisions
From Rinchen Terdzö
((by SublimeText.Mediawiker)) Tag: Manual revert |
((by SublimeText.Mediawiker)) |
||
Line 3: | Line 3: | ||
var results = document.getElementsByClassName("result"); | var results = document.getElementsByClassName("result"); | ||
for (var i = 0; i < results.length; i++) { | for (var i = 0; i < results.length; i++) { | ||
addCounter(results.item(i)) | |||
} | |||
function addCounter() { | |||
let index = element.indexOf(); | |||
let counterDiv = element.querySelectorAll(":scope > div#resultIndex"); | |||
counterDiv.innerHTML = index; | |||
} | } | ||
</script> | </script> |
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() { let index = element.indexOf(); let counterDiv = element.querySelectorAll(":scope > div#resultIndex"); counterDiv.innerHTML = index; }
</script>