Give same result for “Home page” and “Homepage” in search table

Use Regex to replace the whitespace

filter = filter.replace(/\s/g, '')

EDIT for comment

filter = filter.replace(/\s/g,'')
txtValue = txtValue.replace(/\s/g, '')
if (txtValue.toUpperCase().indexOf(filter) > -1) {
  tr[i].style.display = "";    
} else {
  tr[i].style.display = "none";
}
           

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top