Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

126
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda