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

193
Views
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
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!