Browse Source

adjusted search highlight feature to accomodate multiple strings

main
Simon Bowie 2 years ago
parent
commit
863e368a49
1 changed files with 0 additions and 1 deletions
  1. +0
    -1
      site/public/search.php

+ 0
- 1
site/public/search.php View File

const collection = document.getElementsByClassName("search_term"); const collection = document.getElementsByClassName("search_term");
for (let i = 0; i < collection.length; i++) { for (let i = 0; i < collection.length; i++) {
let text = collection[i].textContent; let text = collection[i].textContent;
console.log(collection[i]);
upperText = text.toUpperCase(); upperText = text.toUpperCase();
result = "<span style='color:orange'>" + upperText + "</span>"; result = "<span style='color:orange'>" + upperText + "</span>";
collection[i].innerHTML = result; collection[i].innerHTML = result;

Loading…
Cancel
Save