MediaWiki:ProgressBar.js

var bars = document.getElementById('progressbar'); for(i = 0; i < bars.length; i++) { const width = Number(bars[i].children[0].width.slice(0,2)) if (width > 66) { bars[i].style.backgroundColor = 'green'; }   else if (width > 33) { bars[i].style.backgroundColor = 'yellow'; }   else { bars[i].style.backgroundColor = 'red'; } }