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

287
Views
How to capitalize first letter of textarea HTML?

I am a newbie in web programming and I am looking for a way to capitalize just the first letter of a textarea. I've already tried this solution found on the web but it doesn't work.

<p class="textarea_part">
    <textarea name="#" placeholder="La tua richiesta"></textarea>
</p>

<style>
    .textarea_part::first-letter {
         text-transform: capitalize;
     }
</style>

How can I solve this problem?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Using javascript:

document.querySelector('.textarea_text').addEventListener('input', () => {
  text = document.querySelector('.textarea_text').value;
  document.querySelector('.textarea_text').value = text.charAt(0).toUpperCase() + text.slice(1);
})
<p class="textarea_part">
    <textarea name="#" placeholder="La tua richiesta" class="textarea_text"></textarea>
</p>

Thanks, @marcus-parsons for informing me of the input event listener! It's much faster for the javascript method now.

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!