Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
How to find keywords through JavaScript and locate the scroll bar according to the location of the found keywords?

How to find keywords through JavaScript and locate the scroll bar according to the location of the found keywords? I'm developing a rich text program. Now I don't know how to display the found keywords in the middle of the screen

 function SearchWord(data) {

        let index_all = Indexof_All(data, "a");
        console.log(index_all);

    }



    function Indexof_All(str, v) {

        let index = str.indexOf(v);

        let num = 0;
        let index_arr = [];
        index_arr.push(index);

        while (index !== -1) {
            num++;
            index = str.indexOf(v, index + 1);
            if (index != -1) {
                index_arr.push(index);
            }
        }

        return index_arr;

    }

enter image description here

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda