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

128
Views
userscript: cómo editar el estilo en el elemento html textarea
<textarea data-a-target="chat-input" data-test-selector="chat-input" aria-label="Send message" class="ScInputBase-sc-1wz0osy-0 ScTextArea-sc-1ywwys8-0 kYJGMC InjectLayout-sc-588ddc-0 iZLAMf tw-textarea tw-textarea--no-resize" autocomplete="twitch-chat" maxlength="500" placeholder="Send message" rows="1" style="padding-right: 6.5rem; padding-left: 3.8rem;"></textarea>

quiero agregar line-height: 1.0; en el estilo del elemento textarea pero no tengo idea de hacerlo

 (function() { 'use strict'; var textarea = document.querySelector("textarea") textarea = textarea.replace("style=\"padding-right: 6.5rem; padding-left: 3.8rem;\"","style=\"padding-right: 6.5rem; padding-left: 3.8rem; line-height: 1.0;\""); })();
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Hay una propiedad de style para lograr eso:

 document.querySelector("textarea").style.lineHeight = 1.0;
 <textarea data-a-target="chat-input" data-test-selector="chat-input" aria-label="Send message" class=" ScInputBase-sc-1wz0osy-0 ScTextArea-sc-1ywwys8-0 kYJGMC InjectLayout-sc-588ddc-0 iZLAMf tw-textarea tw-textarea--no-resize " autocomplete="twitch-chat" maxlength="500" placeholder="Send message" rows="1" style="padding-right: 6.5rem; padding-left: 3.8rem" ></textarea>

Además, si insiste en modificar el estilo en línea directamente, es posible que desee usar esto:

 const textarea = document.querySelector("textarea"); textarea.setAttribute("style", textarea.getAttribute("style") + "; line-height: 1.0;");
 <textarea data-a-target="chat-input" data-test-selector="chat-input" aria-label="Send message" class=" ScInputBase-sc-1wz0osy-0 ScTextArea-sc-1ywwys8-0 kYJGMC InjectLayout-sc-588ddc-0 iZLAMf tw-textarea tw-textarea--no-resize " autocomplete="twitch-chat" maxlength="500" placeholder="Send message" rows="1" style="padding-right: 6.5rem; padding-left: 3.8rem"></textarea>

about 4 years ago · Juan Pablo Isaza Report

0

Puedes usar algo como el siguiente código:

 document.getElementById('myID').setAttribute('style', 'background-color: black; color: white');
 <input id="myID"></input>

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!