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

170
Views
Tampermonkey Javascript Establecer atributo para el nombre de la clase

Tengo algunos problemas para establecer un atributo en mi nombre de clase m-date-entry__day-field .

Esto funciona: document.getElementById("create-password").setAttribute("value", "ye345s345"); , pero solo admite Id.

He intentado getElementByClassName, sin ningún éxito.

Elemento: <input class="m-date-entry__day-field" type="number" name="day" min="1" max="31" pattern="\b^(0?[1-9]|[1-2][0-9]|3[0-1])$\b" value="" placeholder="DD" required="" data-date="" data-date-day="" data-test="date-entry-day" tabindex="4" autocomplete="bday-day">

Entonces, mi objetivo final es solo querer establecer el atributo "1".

¿Alguna idea de por qué document.getElementByClassName("m-date-entry__day-field").setAttribute("value", "1");

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!