Update 99_html_footer.html

This commit is contained in:
Yacine31
2023-12-11 17:46:27 +01:00
parent 53aa398c57
commit ec5b98df80

View File

@@ -3,19 +3,20 @@
</body> </body>
<script> <script>
document.addEventListener("DOMContentLoaded", function() { function colorerMots(element) {
var content = document.getElementById("content"); const tds = document.querySelectorAll("td");
var text = content.innerHTML; for (const td of tds) {
const text = td.textContent;
const motsACouleur = ["Error", "Failed", "COMPLETED"];
for (const mot of motsACouleur) {
text = text.replace(mot, `<span style="color: red; background-color: yellow;">${mot}</span>`);
}
td.textContent = text;
}
}
// Remplacez ici les mots que vous souhaitez mettre en surbrillance const element = document.querySelector("table");
var wordsToHighlight = ["DEFERRED"]; colorerMots(element);
wordsToHighlight.forEach(function(word) {
var regex = new RegExp('\\b(' + word + ')\\b', 'gi');
text = text.replace(regex, '<span class="highlight">$1</span>');
});
content.innerHTML = text;
});
</script> </script>
</html> </html>