Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

127
Views
Notification alert if word is found more than two times

I want to generate a notification if the word 'TEST' appears in the webpage anymore than 2 times. I have this code for alerting whenever the word is found , but am unable to frame the code where the alert is announced if the word appears for more than 2 times. Please help me with this. Thank you in advance

if (/TEST/i.test (document.body.innerHTML) )
{
    alert ("Word found!");
}

EDIT This code worked

var str = "TEST"; if (str.split("TEST").length > 2)
 {    alert("Word Found")
 }
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!