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

260
Views
How do I change the color of specific text in a contenteditable textarea

May someone please tell me how to get specifically set text to change color through Javascript in a textarea like a IDE does

<textarea placeholder="place code here">Put Scripts Here</textarea><script src="/editor/codelib.js"></script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

HTML

<textarea onkeyup="checkWord(this)"></textarea>

JavaScript

        function checkWord(word)
            {
                if (word.value == "hello" || "world") {
                    word.style.color='orange'
                } 
                else if (word.value == "!" || ".") {
                    world.style.color='red'
                }
                else {
                    word.style.color='#FFF'
                }
            }
about 4 years ago · Juan Pablo Isaza Report
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!